Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
 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)
Exemplo n.º 8
0
 def test_include_define(self, print_mock):
     sfzlint()
     self.assertFalse(print_mock.called, print_mock.call_args_list)
Exemplo n.º 9
0
 def test_valid_file(self, print_mock):
     sfzlint()
     self.assertFalse(print_mock.called, print_mock.call_args_list)
Exemplo n.º 10
0
 def test_rel_path(self):
     with patch('builtins.print') as print_mock:
         sfzlint()
     self.assertFalse(print_mock.called, print_mock.call_args_list)