Beispiel #1
0
 def assert_error(self, addr: str, exc_cls: Type[Exception]):
     with pytest.raises(ExecutionError) as excinfo:
         self.request_single_product(
             SetupPyChroot,
             Params(SetupPyChrootRequest(ExportedTarget(self.tgt(addr))),
                    SourceRootConfig.global_instance()))
     ex = excinfo.value
     assert len(ex.wrapped_exceptions) == 1
     assert type(ex.wrapped_exceptions[0]) == exc_cls
Beispiel #2
0
 def assert_chroot(self, expected_files, expected_setup_kwargs, addr):
     chroot = self.request_single_product(
         SetupPyChroot,
         Params(SetupPyChrootRequest(ExportedTarget(self.tgt(addr))),
                SourceRootConfig.global_instance()))
     snapshot = self.request_single_product(Snapshot, Params(chroot.digest))
     assert sorted(expected_files) == sorted(snapshot.files)
     kwargs = json.loads(chroot.setup_keywords_json)
     assert expected_setup_kwargs == kwargs
Beispiel #3
0
 def assert_chroot(self, expected_files, expected_setup_kwargs, addr):
     chroot = self.request_single_product(
         SetupPyChroot,
         Params(
             SetupPyChrootRequest(ExportedTarget(self.tgt(addr)),
                                  py2=False),
             create_options_bootstrapper(),
         ),
     )
     snapshot = self.request_single_product(Snapshot, Params(chroot.digest))
     assert sorted(expected_files) == sorted(snapshot.files)
     kwargs = json.loads(chroot.setup_keywords_json)
     assert expected_setup_kwargs == kwargs
Beispiel #4
0
 def assert_error(self, addr: str, exc_cls: Type[Exception]):
     with pytest.raises(ExecutionError) as excinfo:
         self.request_single_product(
             SetupPyChroot,
             Params(
                 SetupPyChrootRequest(ExportedTarget(self.tgt(addr)),
                                      py2=False),
                 create_options_bootstrapper(),
             ),
         )
     ex = excinfo.value
     assert len(ex.wrapped_exceptions) == 1
     assert type(ex.wrapped_exceptions[0]) == exc_cls