Skip to content

Commit

Permalink
Account for BUILD files in tests (count and file list)
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Sep 21, 2022
1 parent 3520186 commit 080d40a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion st2api/tests/unit/controllers/v1/test_packs_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_get_pack_files_and_pack_file_ref_doesnt_equal_pack_name(self):
# Ref is not equal to the name, controller should still work
resp = self.app.get("/v1/packs/views/files/dummy_pack_16")
self.assertEqual(resp.status_int, http_client.OK)
self.assertEqual(len(resp.json), 3)
self.assertEqual(len(resp.json), 4)
self.assertIn("pack.yaml", [f["file_path"] for f in resp.json])

resp = self.app.get("/v1/packs/views/file/dummy_pack_16/pack.yaml")
Expand Down
3 changes: 2 additions & 1 deletion st2common/tests/unit/test_util_file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def test_get_file_list(self):
# Standard exclude pattern
directory = os.path.join(ST2TESTS_DIR, "policies")
expected = [
"BUILD",
"mock_exception.py",
"concurrency.py",
"__init__.py",
Expand All @@ -48,6 +49,6 @@ def test_get_file_list(self):
"meta/__init__.py",
]
result = get_file_list(
directory=directory, exclude_patterns=["*.pyc", "*.yaml"]
directory=directory, exclude_patterns=["*.pyc", "*.yaml", "BUILD"]
)
self.assertItemsEqual(expected, result)

0 comments on commit 080d40a

Please sign in to comment.