def test_get_mypy_cmd_with_files(self): expected_cmd = [ 'mypy', '--config-file', './mypy.ini', 'file1.py', 'file2.py' ] with self.files_swap: with self.directories_swap: cmd = run_mypy_checks.get_mypy_cmd(['file1.py', 'file2.py']) self.assertEqual(cmd, expected_cmd)
def test_get_mypy_cmd_without_files(self): expected_cmd = [ 'mypy', '--exclude', 'file1.py|file2.py|dir1/|dir2/', '--config-file', './mypy.ini', '.' ] with self.files_swap: with self.directories_swap: cmd = run_mypy_checks.get_mypy_cmd(None) self.assertEqual(cmd, expected_cmd)
def test_get_mypy_cmd_for_ci(self): with self.files_swap: with self.directories_swap: cmd = run_mypy_checks.get_mypy_cmd(None, self.mypy_cmd_path, True) self.assertEqual(cmd[0], 'mypy')