def test_missing_sample(self, print_mock): sfzlint() self.assertTrue(print_mock.called) calls = [ ErrMsg(*a[0][0].split(':')) for a in print_mock.call_args_list ] self.assert_has_message('file not found', calls)
def test_invalid_file(self, print_mock): sfzlint() self.assertTrue(print_mock.called) calls = [ ErrMsg(*a[0][0].split(':')) for a in print_mock.call_args_list ] self.assert_has_message('unknown opcode', calls)
def test_spec_version(self, print_mock): sfzlint() self.assertTrue(print_mock.called) calls = [ ErrMsg(*a[0][0].split(':')) for a in print_mock.call_args_list ] self.assert_has_message('header spec v2 not in', calls) self.assert_has_message('opcode spec v2 is not', calls)
def test_include_parse_error(self): with patch('builtins.print') as print_mock: sfzlint() self.assertTrue(print_mock.called) calls = [ ErrMsg(*a[0][0].split(':', 3)) for a in print_mock.call_args_list ] self.assert_has_message('error loading include', calls)
def test_lint_dir(self): with patch('builtins.print') as print_mock: sfzlint() self.assertTrue(print_mock.called) calls = [ ErrMsg(*a[0][0].split(':')) for a in print_mock.call_args_list ] self.assert_has_message('unknown opcode', calls)
def test_xml_with_defines(self): with patch('builtins.print') as print_mock: sfzlint() self.assertTrue(print_mock.called) calls = [ ErrMsg(*a[0][0].split(':')) for a in print_mock.call_args_list ] self.assertEqual(1, len(calls), calls) self.assertIn('foo', calls[0].message)
def test_bad_case(self): with patch('builtins.print') as print_mock: sfzlint() self.assertTrue(print_mock.called) calls = [ ErrMsg(*a[0][0].split(':')) for a in print_mock.call_args_list ] if (is_fs_case_insensitive): self.assert_has_message('case does not match', calls) else: self.assert_has_message('file not found', calls)
def test_include_define(self, print_mock): sfzlint() self.assertFalse(print_mock.called, print_mock.call_args_list)
def test_valid_file(self, print_mock): sfzlint() self.assertFalse(print_mock.called, print_mock.call_args_list)
def test_rel_path(self): with patch('builtins.print') as print_mock: sfzlint() self.assertFalse(print_mock.called, print_mock.call_args_list)