Update 'echo' tests

This commit is contained in:
fe7ch
2017-03-15 19:06:52 +03:00
parent 9d024b9b2e
commit 88577794b1
2 changed files with 16 additions and 3 deletions

View File

@ -77,10 +77,20 @@
"root +pts\/0 +2[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-3][0-9]:[0-5][0-9][0-9(). ]+",
"root@unitTest:~# "
],
"echo": [
"echo": {
"plain": [
"test worked correctly",
"root@unitTest:~# "
],
"ne_double": [
"ELF",
"root@unitTest:~# "
],
"ne_single": [
"ELF",
"root@unitTest:~# "
]
},
"hostname": [
"root@unitChanged:~# "
],

View File

@ -52,8 +52,11 @@ class ShellBaseCommandsTests(unittest.TestCase):
def test_echo_command(self):
self.proto.lineReceived('echo "test worked correctly" \n')
self.assertEquals(self.tr.value(),"\n".join(self.data['results']['echo']))
self.assertEquals(self.tr.value(),"\n".join(self.data['results']['echo']['plain']))
self.proto.lineReceived('echo -ne "\x27\x22\x45\x4c\x46\x27\x22" \n')
self.assertEquals(self.tr.value(), "\n".join(self.data['results']['echo']['ne_double']))
self.proto.lineReceived('echo -ne \'\x27\x22\x45\x4c\x46\x27\x22\' \n')
self.assertEquals(self.tr.value(), "\n".join(self.data['results']['echo']['ne_single']))
def test_exit_command(self):
self.proto.lineReceived('exit \n')