def test__validate_true(self): """Check valid prefix""" # Arrange prefix = b"DDS etc" # Act output = DdsImagePlugin._validate(prefix) # Assert self.assertTrue(output)
def test__validate_false(self): """Check invalid prefix""" # Arrange prefix = b"something invalid" # Act output = DdsImagePlugin._validate(prefix) # Assert self.assertFalse(output)
def test__accept_false(): """Check invalid prefix""" # Arrange prefix = b"something invalid" # Act output = DdsImagePlugin._accept(prefix) # Assert assert not output
def test__accept_true(): """Check valid prefix""" # Arrange prefix = b"DDS etc" # Act output = DdsImagePlugin._accept(prefix) # Assert assert output
def test_invalid_file(): invalid_file = "Tests/images/flower.jpg" with pytest.raises(SyntaxError): DdsImagePlugin.DdsImageFile(invalid_file)