def test_CreateXMLOutputFilename_ValidPathToFileAndOutputDir_XMLPathCreated( self, mock_abspath): test_path_to_file = os.path.join('path', 'to', 'module.dll') test_output_dir = os.path.join('TestResults', 'Timestamp') scanner.create_xml_output_filename(test_path_to_file, test_output_dir) expected_path = os.path.join(test_output_dir, "test_results_module.xml") mock_abspath.assert_called_with(expected_path)
def test_CreateXMLOutputFilename_OutputDirIsNone_ThrowsTypeError(self): with self.assertRaises(TypeError) as ex: scanner.create_xml_output_filename("PathToFile", None)
def test_CreateXMLOutputFilename_PathToFileIsNone_ThrowsInvalidUseError( self): with self.assertRaises(InvalidUseError) as ex: scanner.create_xml_output_filename(None, "OutputDir")