def reject_removal_test(self): mocked_user_io = UserIO(out=TestBufferConanOutput()) mocked_user_io.request_boolean = Mock(return_value=False) self.client.run("remove hello/* -s -b -p", user_io=mocked_user_io) self.assert_folders({"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]}, {"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]}, {"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]}, {"H1": True, "H2": True, "B": True, "O": True})
def basic_mocked_test(self): mocked_user_io = UserIO(out=TestBufferConanOutput()) mocked_user_io.request_boolean = Mock(return_value=True) self.client.run("remove hello/*", user_io=mocked_user_io) self.assert_folders({"H1": None, "H2": None, "B": [1, 2], "O": [1, 2]}, {"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]}, {"H1": None, "H2": None, "B": [1, 2], "O": [1, 2]}, {"H1": False, "H2": False, "B": True, "O": True}) folders = os.listdir(self.client.storage_folder) six.assertCountEqual(self, ["Other", "Bye"], folders)
def basic_mocked_test(self): mocked_user_io = UserIO(out=TestBufferConanOutput()) mocked_user_io.request_boolean = Mock(return_value=True) self.client.run("remove hello/*", user_io=mocked_user_io) self.assert_folders( {"H1": None, "H2": None, "B": [1, 2], "O": [1, 2]}, {"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]}, {"H1": None, "H2": None, "B": [1, 2], "O": [1, 2]}, {"H1": False, "H2": False, "B": True, "O": True}, )
def src_test(self): mocked_user_io = UserIO(out=TestBufferConanOutput()) mocked_user_io.request_boolean = Mock(return_value=True) self.client.run("remove hello/* -s", user_io=mocked_user_io) self.assert_folders({"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]}, {"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]}, {"H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2]}, {"H1": False, "H2": False, "B": True, "O": True}) folders = os.listdir(self.client.storage_folder) six.assertCountEqual(self, ["Hello", "Other", "Bye"], folders) six.assertCountEqual(self, ["package", "build", "export"], os.listdir(os.path.join(self.client.storage_folder, "Hello/1.4.10/fenix/testing"))) six.assertCountEqual(self, ["package", "build", "export"], os.listdir(os.path.join(self.client.storage_folder, "Hello/2.4.11/fenix/testing")))
def builds_test(self): mocked_user_io = UserIO(out=TestBufferConanOutput()) mocked_user_io.request_boolean = Mock(return_value=True) self.client.run("remove hello/* -b", user_io=mocked_user_io) self.assert_folders(local_folders={ "H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2] }, remote_folders={ "H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2] }, build_folders={ "H1": [], "H2": [], "B": [1, 2], "O": [1, 2] }, src_folders={ "H1": True, "H2": True, "B": True, "O": True }) folders = os.listdir(self.client.storage_folder) six.assertCountEqual(self, ["Hello", "Other", "Bye"], folders) six.assertCountEqual( self, [ "package", "source", "export", "export_source", "metadata.json", "metadata.json.lock" ], os.listdir( os.path.join(self.client.storage_folder, "Hello/1.4.10/myuser/testing"))) six.assertCountEqual( self, [ "package", "source", "export", "export_source", "metadata.json", "metadata.json.lock" ], os.listdir( os.path.join(self.client.storage_folder, "Hello/2.4.11/myuser/testing")))
def src_test(self): mocked_user_io = UserIO(out=TestBufferConanOutput()) mocked_user_io.request_boolean = Mock(return_value=True) self.client.run("remove hello/* -s", user_io=mocked_user_io) self.assert_folders( { "H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2] }, { "H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2] }, { "H1": [1, 2], "H2": [1, 2], "B": [1, 2], "O": [1, 2] }, { "H1": False, "H2": False, "B": True, "O": True }) folders = os.listdir(self.client.storage_folder) six.assertCountEqual(self, ["Hello", "Other", "Bye"], folders) six.assertCountEqual( self, ["package", "build", "export"], os.listdir( os.path.join(self.client.storage_folder, "Hello/1.4.10/fenix/testing"))) six.assertCountEqual( self, ["package", "build", "export"], os.listdir( os.path.join(self.client.storage_folder, "Hello/2.4.11/fenix/testing")))