def _initialize_entity(self, entity_type, git=GIT_PATH): api.init('repository') api.remote_add(entity_type, git) api.storage_add(bucket_type=STORAGE_TYPE, bucket_name=BUCKET_NAME, credentials=PROFILE) api.init(entity_type) metadata_path = os.path.join(self.tmp_dir, ML_GIT_DIR, entity_type, 'metadata') self.assertTrue(os.path.exists(metadata_path))
def _add_remote(self, entity_type): api.init('repository') api.remote_add(entity_type, os.path.join(self.tmp_dir, GIT_PATH)) with open(os.path.join(self.tmp_dir, ML_GIT_DIR, 'config.yaml'), 'r') as c: config = yaml_processor.load(c) self.assertEqual(os.path.join(self.tmp_dir, GIT_PATH), config[entity_type]['git'])