示例#1
0
    def test_addRemoveStorageType(self):
        Resources.addStorageType(9901, "YAY")
        Resources.addType(9902, "whoo")
        Resources.addStorageType(100, "herpderp")

        with pytest.raises(ResourceTypeError):
            # We can't add the same type again
            Resources.addStorageType(9901, "nghha")

        Resources.removeType(9001)
        Resources.removeType(9902)

        with pytest.raises(ResourceTypeError):
            # We can't do that, since it's in the range of user types.
            Resources.removeType(100)

        with pytest.raises(ResourceTypeError):
            # We can't do that, since it's in the range of user types.
            Resources.addType(102, "whoo")
示例#2
0
 def teardown_class(cls):
     Resources.removeType(cls.config_parser_type)
     cls.data = {}