Example #1
0
class CommandsTester(TestCase):

    def setUp(self):
        self.commands = LowShellCommands()
        pass

    def tearDown(self):

        pass

    def test_notfound(self):

        self.stringio()

        self.assertFalse(self.commands.notfound())
        self.assertEqual(
                self.getvalue(),
                "CommandError: "
                "command not found\n")

    def test_pwd(self):

        self.stringio()


        os.chdir(os.environ["HOME"])
        self.commands.pwd()

        self.assertEqual(self.getvalue(), os.environ["HOME"]+"\n")
Example #2
0
 def setUp(self):
     self.commands = LowShellCommands()
     pass