def testExtractShortCommandNames(self): values = ( (':', ':'), ('!', '!'), ) for v, expected in values: self.assertEquals(extract_command_name(v), expected)
def testExtractValidCommandNamesCorrectly(self): values = ( ('foo100', 'foo'), ('foo', 'foo'), ('foo:', 'foo'), ('foo/', 'foo'), ) for v, expected in values: self.assertEquals(extract_command_name(v), expected)
def test_extract_command_name(): assert extract_command_name('whatever!') == 'whatever' assert extract_command_name('hello world') == 'hello' assert extract_command_name('hello++opt1=foo') == 'hello'