Skip to content

Commit

Permalink
Move asserts so it fails early
Browse files Browse the repository at this point in the history
  • Loading branch information
minitriga committed Jan 9, 2025
1 parent e36bc67 commit 0996934
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/integration/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ async def test_add_repository(self, client: InfrahubClient, remote_repos_dir):
src_directory = get_fixtures_dir() / "integration/mock_repo"
repo = GitRepo(name="mock_repo", src_directory=src_directory, dst_directory=remote_repos_dir)
commit = repo._repo.git[repo._repo.git.head()]
response = await repo.add_to_infrahub(client=client)
repos = await client.all(kind=repo.type)

assert len(list(repo._repo.git.get_walker())) == 1
assert commit.message.decode("utf-8") == "First commit"
response = await repo.add_to_infrahub(client=client)
repos = await client.all(kind=repo.type)
assert response.get(f"{repo.type.value}Create", {}).get("ok")
assert len(repos) == 1

0 comments on commit 0996934

Please sign in to comment.