def test_parse(self): line = 'command="PYTHONPATH=/home/epeli/SubUser/ SubUser/bin/subssh -t foobar" ssh-rsa avain== kommentti' username, type, key, comment = parse_subssh_key(line) self.assertEquals(username, "foobar") self.assertEquals(type, "ssh-rsa") self.assertEquals(key, "avain==") self.assertEquals(comment, "kommentti")
def test_simple_cmd(self): line = 'command="subssh -t foobar" ssh-rsa avain== kommentti' username, type, key, comment = parse_subssh_key(line) self.assertEquals(username, "foobar") self.assertEquals(type, "ssh-rsa") self.assertEquals(key, "avain==") self.assertEquals(comment, "kommentti")
def test_no_comment(self): line = 'command="PYTHONPATH=/home/epeli/SubUser/ SubUser/bin/subssh -t foobar" ssh-rsa avain==' username, type, key, comment = parse_subssh_key(line) self.assertEquals(comment, "")
def test_parse_multiple_comment_words(self): line = 'command="PYTHONPATH=/home/epeli/SubUser/ SubUser/bin/subssh -t foobar" ssh-rsa avain== monisanainen kommentti' username, type, key, comment = parse_subssh_key(line) self.assertEquals(comment, "monisanainen kommentti")