Пример #1
0
 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")
Пример #2
0
 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")
     
Пример #3
0
 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, "")        
Пример #4
0
 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")