Beispiel #1
0
 def test_can_call_dependency_builder(self, osutils):
     mock_dep_builder = mock.Mock(spec=DependencyBuilder)
     osutils_mock = mock.Mock(spec=osutils)
     builder = PythonPipDependencyBuilder(
         osutils=osutils_mock, dependency_builder=mock_dep_builder, runtime="runtime"
     )
     builder.build_dependencies("artifacts/path/", "scratch_dir/path/", "path/to/requirements.txt")
     mock_dep_builder.build_site_packages.assert_called_once_with(
         "path/to/requirements.txt", "artifacts/path/", "scratch_dir/path/"
     )
     osutils_mock.file_exists.assert_called_once_with("path/to/requirements.txt")
Beispiel #2
0
 def test_can_create_new_dependency_builder(self, DependencyBuilderMock,
                                            osutils):
     osutils_mock = mock.Mock(spec=osutils)
     builder = PythonPipDependencyBuilder(osutils=osutils_mock,
                                          runtime="runtime")
     DependencyBuilderMock.assert_called_with(osutils_mock,
                                              "runtime",
                                              architecture=X86_64)
Beispiel #3
0
 def test_can_call_dependency_builder_with_architecture(
         self, DependencyBuilderMock, osutils):
     osutils_mock = mock.Mock(spec=osutils)
     builder = PythonPipDependencyBuilder(osutils=osutils_mock,
                                          runtime="runtime",
                                          architecture=ARM64)
     DependencyBuilderMock.assert_called_with(osutils_mock,
                                              "runtime",
                                              architecture=ARM64)