Пример #1
0
 def test_init(self) -> None:
     filter_ = Filter("myschema", "postgres", VersionMatcher(5, 10, 3))
     assert filter_.schema == "myschema"
     assert filter_.dialect == "postgres"
     assert filter_.version_matcher == VersionMatcher(5, 10, 3)
Пример #2
0
 def test_matches__api_level_too_large(self) -> None:
     filter_ = Filter("myschema", "postgres", VersionMatcher(5, 10, 3))
     file_info = FileInfo("", "myschema", "postgres", 7, 4)
     assert not filter_.matches(file_info)
Пример #3
0
 def test_matches__wrong_dialect(self) -> None:
     filter_ = Filter("myschema", "postgres", VersionMatcher(5, 10, 3))
     file_info = FileInfo("", "myschema", "mysql", 5, 2)
     assert not filter_.matches(file_info)
Пример #4
0
 def test_matches__min_version_too_large(self) -> None:
     filter_ = Filter("myschema", "postgres", VersionMatcher(5, 10, 3))
     file_info = FileInfo("", "myschema", "postgres", 11, 2)
     assert not filter_.matches(file_info)
Пример #5
0
 def test_matches__version_matches_upper(self) -> None:
     filter_ = Filter("myschema", "postgres", VersionMatcher(5, 10, 3))
     file_info = FileInfo("", "myschema", "postgres", 10, 2)
     assert filter_.matches(file_info)