Example #1
0
    def test_compare(self):
        """Test the optional compare argument."""
        parser = parse_args(['-g', '10', '-s', 'bubble', '-c'])
        self.assertTrue(parser.compare)
        self.assertEqual(True, parser.compare)

        parser = parse_args(['-g', '10', '-s', 'bubble'])
        self.assertEqual(False, parser.compare)
Example #2
0
    def test_list(self):
        """Test the optional list argument."""
        parser = parse_args(['-g', '10', '-s', 'bubble', '-l'])
        self.assertTrue(parser.list)
        self.assertEqual(True, parser.list)

        parser = parse_args(['-g', '10', '-s', 'bubble'])
        self.assertEqual(False, parser.list)
Example #3
0
    def test_allsorts(self):
        """Test the optional one of: allsorts argument."""
        parser = parse_args(['-g', '10', '-a'])
        self.assertTrue(parser.allsorts)
        self.assertEqual(True, parser.allsorts)

        parser = parse_args(['-g', '10', '-s', 'bubble'])
        self.assertEqual(False, parser.allsorts)
Example #4
0
 def test_sort(self):
     """Test the optional one of: sort argument."""
     parser = parse_args(['-g', '10', '-s', 'bubble'])
     self.assertTrue(parser.sort)
Example #5
0
 def test_generate(self):
     """Test the optional one of: generate argument."""
     parser = parse_args(['-g', '100', '-s', 'bubble'])
     self.assertTrue(parser.generate)
Example #6
0
 def test_integers(self):
     """Test the optional one of: integers argument."""
     parser = parse_args(['-i', '1', '3', '6', '9', '-s', 'bubble'])
     self.assertTrue(parser.integers)