def test_read_deployment_file(self, set_path, deploy_file): """ Tests if we can read deployment file. :param set_path: pype setup root path :type set_path: string :param deploy_file: path to valid temporary deploy file :type deploy_file: string """ d = Deployment(set_path) data = d._read_deployment_file(deploy_file) assert data.get('repositories')[0].get('name') == "avalon-core" assert data.get('repositories')[1].get('branch') == "develop"
def test_read_invalid_deployment_file(self, set_path): d = Deployment(set_path) with pytest.raises(FileNotFoundError): d._read_deployment_file('wfjagp')
def test_validate_schema(self, invalid_deploy_file, deploy_file): d = Deployment(os.path.abspath('.')) r = d._validate_schema(d._read_deployment_file(invalid_deploy_file)) assert r is False r = d._validate_schema(d._read_deployment_file(deploy_file)) assert r is True