def test_validate_bad_interface(self): han = TestHandler2() try: interface.validate(TestInterface, han, []) except exc.InterfaceError as e: self.eq(e.msg, "%s does not implement %s." % (han, TestInterface)) raise
def test_validate_bad_interface_missing_meta(self): han = TestHandler() try: interface.validate(TestInterface, han, [], ['missing_meta']) except exc.InterfaceError as e: self.eq(e.msg, "Invalid or missing: ['_meta.missing_meta'] in %s" % han) raise
def test_validate_bad_interface_no_meta(self): han = TestHandler3() try: interface.validate(TestInterface, han, []) except exc.InterfaceError as e: self.eq(e.msg, "Invalid or missing: ['_meta'] in %s" % han) raise
def cmd_interface_validator(cls, obj): members = [ '_setup', 'command', 'monitor', ] interface.validate(ICommand, obj, members)
def wrapper_interface_validator(cls, obj): members = [ 'cl', 'cmd_args', 'version', ] interface.validate(IWrapper, obj, members)
def database_validator(klass, obj): """Verify that a handler satisfies the Database interface.""" members = [ '__setitem__', '__getitem__', ] validate(IDatabase, obj, members)
def rest_api_validator(klass, obj): """Validates an handler implementation against the IREST interface.""" members = [ '_setup', 'reset', 'resources', 'make_request', ] interface.validate(IRESTApi, obj, members)
def server_validator(class_, obj): members = [ "_setup", "start", "stop", "_run", "exit", ] interface.validate(IServerManager, obj, members)
def encryptedfs_validator(class_, obj): members = [ "_setup", "mount", "mkfs", "umount", "is_mounted_at", ] interface.validate(IEncryptedFS, obj, members)
def versioncontrol_validator(class_, obj): members = [ "_setup", "setup_repository", "new_repository", "get_repos_path", "is_versioncontrol_command", "get_needed_permission", "get_sane_command" ] interface.validate(IVersionControl, obj, members)
def test_validator(self): interface.validate(TestInterface, TestHandler(), [])
def cmd_interface_validator(cls, obj): members = ["_setup", "command", "monitor"] interface.validate(ICommand, obj, members)