def test_is_valid_file_path(self, path, answer, mocker): mocker.patch.object(StructureValidator, "load_data_from_file", return_value=None) structure = StructureValidator(path) structure.scheme_name = None assert structure.is_valid_file_path() is answer
def mock_structure(file_path=None, current_file=None, old_file=None): # type: (Optional[str], Optional[dict], Optional[dict]) -> StructureValidator with patch.object(StructureValidator, '__init__', lambda a, b: None): structure = StructureValidator(file_path) structure.is_valid = True structure.scheme_name = 'integration' structure.file_path = file_path structure.current_file = current_file structure.old_file = old_file return structure