"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/unit/build_providers/test_base_provider.py" between
snapcraft-4.5.1.tar.gz and snapcraft-4.5.2.tar.gz

About: Snapcraft is a build and packaging tool that makes it easy to incorporate components from different sources and build technologies or solutions.

test_base_provider.py  (snapcraft-4.5.1):test_base_provider.py  (snapcraft-4.5.2)
skipping to change at line 108 skipping to change at line 108
provider = ProviderImpl(project=self.project, echoer=self.echoer_mock) provider = ProviderImpl(project=self.project, echoer=self.echoer_mock)
provider.start_mock.side_effect = errors.ProviderInstanceNotFoundError( provider.start_mock.side_effect = errors.ProviderInstanceNotFoundError(
instance_name=self.instance_name instance_name=self.instance_name
) )
provider.launch_instance() provider.launch_instance()
provider.launch_mock.assert_any_call() provider.launch_mock.assert_any_call()
provider.start_mock.assert_any_call() provider.start_mock.assert_any_call()
provider.save_info_mock.assert_called_once_with( provider.save_info_mock.assert_called_once_with(
{"data": {"base": "core16", "created-by-snapcraft-version": "4.0"}} {
"data": {
"base": "core16",
"created-by-snapcraft-version": "4.0",
"host-project-directory": self.project._project_dir,
}
}
) )
self.assertThat( self.assertThat(
provider.run_mock.mock_calls, provider.run_mock.mock_calls,
Equals( Equals(
[ [
call(["mv", "/var/tmp/L3Jvb3QvLmJhc2hyYw==", "/root/.bashrc" ]), call(["mv", "/var/tmp/L3Jvb3QvLmJhc2hyYw==", "/root/.bashrc" ]),
call(["chown", "root:root", "/root/.bashrc"]), call(["chown", "root:root", "/root/.bashrc"]),
call(["chmod", "0600", "/root/.bashrc"]), call(["chmod", "0600", "/root/.bashrc"]),
call( call(
skipping to change at line 552 skipping to change at line 558
( (
"different-base-clean", "different-base-clean",
dict( dict(
base="core16", base="core16",
loaded_info={"base": "core18", "created-by-snapcraft-version": " 1.0"}, loaded_info={"base": "core18", "created-by-snapcraft-version": " 1.0"},
version="1.0", version="1.0",
expect_clean=True, expect_clean=True,
), ),
), ),
( (
"same-project-dir-no-clean",
dict(
base="core18",
loaded_info={
"base": "core18",
"created-by-snapcraft-version": "1.0",
"host-project-directory": "/fake/host/dir",
},
version="1.0",
expect_clean=False,
),
),
(
"no-project-dir-no-clean",
dict(
base="core18",
loaded_info={"base": "core18", "created-by-snapcraft-version": "
1.0"},
version="1.0",
expect_clean=False,
),
),
(
"different-project-dir-clean",
dict(
base="core18",
loaded_info={
"base": "core18",
"created-by-snapcraft-version": "1.0",
"host-project-directory": "/nowhere",
},
version="1.0",
expect_clean=True,
),
),
(
"unspecified-base-clean", "unspecified-base-clean",
dict( dict(
base="core20", base="core20",
loaded_info={"created-by-snapcraft-version": "1.0"}, loaded_info={"created-by-snapcraft-version": "1.0"},
version="1.0", version="1.0",
expect_clean=True, expect_clean=True,
), ),
), ),
( (
"unspecified-created-version-clean", "unspecified-created-version-clean",
skipping to change at line 601 skipping to change at line 642
loaded_info={"base": "core20", "created-by-snapcraft-version": " 2.0"}, loaded_info={"base": "core20", "created-by-snapcraft-version": " 2.0"},
version="3.0", version="3.0",
expect_clean=False, expect_clean=False,
), ),
), ),
] ]
def test_scenario( def test_scenario(
self, monkeypatch, in_snap, base, loaded_info, version, expect_clean self, monkeypatch, in_snap, base, loaded_info, version, expect_clean
): ):
monkeypatch.setattr("os.getcwd", lambda: "/fake/host/dir")
monkeypatch.setenv("SNAP_VERSION", version) monkeypatch.setenv("SNAP_VERSION", version)
provider = ProviderImpl(project=get_project(), echoer=Mock()) provider = ProviderImpl(project=get_project(), echoer=Mock())
provider.project._snap_meta.base = base provider.project._snap_meta.base = base
provider.loaded_info = loaded_info provider.loaded_info = loaded_info
provider._ensure_compatible_build_environment() provider._ensure_compatible_build_environment()
if expect_clean: if expect_clean:
provider.clean_project_mock.assert_called_once_with() provider.clean_project_mock.assert_called_once_with()
 End of changes. 3 change blocks. 
1 lines changed or deleted 44 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)