Skip to content

Commit

Permalink
wrote test is valid bag, wrote function is valid bag
Browse files Browse the repository at this point in the history
  • Loading branch information
dreyjo committed Jul 21, 2023
1 parent ab119c6 commit d5a3bdd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bd_validator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import pathlib
import bagit

def is_valid_bag(source: pathlib.Path) -> bool:
bag = bagit.Bag(str(source))
return bag.validate()
11 changes: 11 additions & 0 deletions test_bd_validator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import bd_validator as bv
import pytest
from pathlib import Path

@pytest.fixture
def good_package():
return Path("fixtures/simple_video_pk")

def test_is_package_bag(good_package):
result = bv.is_valid_bag(good_package)
assert result is True

0 comments on commit d5a3bdd

Please sign in to comment.