Exemple #1
0
 def test_main_with_unicode(self, fake_shell):
     unicode_text = u'\u7f51\u7edc'
     argv = ['net-list', unicode_text, unicode_text]
     fake_shell.return_value = 0
     ret = openstack_shell.main(argv=argv)
     fake_shell.assert_called_once_with(
         [u'net-list', unicode_text, unicode_text])
     self.assertEqual(0, ret)
 def test_main_with_unicode(self, fake_shell):
     unicode_text = u'\u7f51\u7edc'
     argv = ['net-list', unicode_text, unicode_text]
     fake_shell.return_value = 0
     ret = openstack_shell.main(argv=argv)
     fake_shell.assert_called_once_with([u'net-list', unicode_text,
                                        unicode_text])
     self.assertEqual(0, ret)
Exemple #3
0
 def test_main_with_unicode(self):
     self.mox.StubOutClassWithMocks(openstack_shell, 'NeutronShell')
     qshell_mock = openstack_shell.NeutronShell('2.0')
     unicode_text = u'\u7f51\u7edc'
     argv = ['net-list', unicode_text, unicode_text]
     qshell_mock.run([u'net-list', unicode_text, unicode_text]).AndReturn(0)
     self.mox.ReplayAll()
     ret = openstack_shell.main(argv=argv)
     self.mox.VerifyAll()
     self.mox.UnsetStubs()
     self.assertEqual(0, ret)
 def test_main_with_unicode(self):
     self.mox.StubOutClassWithMocks(openstack_shell, "NeutronShell")
     qshell_mock = openstack_shell.NeutronShell("2.0")
     unicode_text = u"\u7f51\u7edc"
     argv = ["net-list", unicode_text, unicode_text]
     qshell_mock.run([u"net-list", unicode_text, unicode_text]).AndReturn(0)
     self.mox.ReplayAll()
     ret = openstack_shell.main(argv=argv)
     self.mox.VerifyAll()
     self.mox.UnsetStubs()
     self.assertEqual(ret, 0)
 def test_main_with_unicode(self):
     self.mox.StubOutClassWithMocks(openstack_shell, 'NeutronShell')
     qshell_mock = openstack_shell.NeutronShell('2.0')
     unicode_text = u'\u7f51\u7edc'
     argv = ['net-list', unicode_text, unicode_text.encode('utf-8')]
     qshell_mock.run([u'net-list', unicode_text,
                      unicode_text]).AndReturn(0)
     self.mox.ReplayAll()
     ret = openstack_shell.main(argv=argv)
     self.mox.VerifyAll()
     self.mox.UnsetStubs()
     self.assertEqual(ret, 0)