Esempio n. 1
0
 def test_mult_app_table_format(self):
     output = cli.format_application(self.apps, "table")
     expected = ("| Application   |\n|---------------|\n| fake_package  |"
                 "\n| fake_package  |")
     self.assertEqual(output, expected)
Esempio n. 2
0
 def test_mult_app_json_format(self, to_dict):
     to_dict.return_value = vars(self.apps[0])
     output = json.loads(cli.format_application(self.apps, "json"))
     expected = [vars(self.apps[0]), vars(self.apps[0])]
     self.assertEqual(output, expected)
Esempio n. 3
0
 def test_single_app_table_format(self):
     output = cli.format_application(self.apps[0], "table")
     expected = "| Application   |\n|---------------|\n| fake_package  |"
     self.assertEqual(output, expected)
Esempio n. 4
0
 def test_single_app_blocks_format(self):
     output = cli.format_application(self.apps[0])
     expected = cli.APPLICATION_TEMPLATE.format(self=self.apps[0])
     self.assertEqual(output, expected)
Esempio n. 5
0
 def test_mult_app_blocks_format(self):
     output = cli.format_application(self.apps)
     expected = "\n\n{block}\n\n{block}".format(
         block=cli.APPLICATION_TEMPLATE.format(self=self.apps[0]),
     )
     self.assertEqual(output, expected)
Esempio n. 6
0
 def test_mult_app_table_format(self):
     output = cli.format_application(self.apps, "table")
     expected = ("| Application   |\n|---------------|\n| fake_package  |"
                 "\n| fake_package  |")
     self.assertEqual(output, expected)
Esempio n. 7
0
 def test_single_app_table_format(self):
     output = cli.format_application(self.apps[0], "table")
     expected = "| Application   |\n|---------------|\n| fake_package  |"
     self.assertEqual(output, expected)
Esempio n. 8
0
 def test_mult_app_json_format(self, to_dict):
     to_dict.return_value = vars(self.apps[0])
     output = json.loads(cli.format_application(self.apps, "json"))
     expected = [vars(self.apps[0]), vars(self.apps[0])]
     self.assertEqual(output, expected)
Esempio n. 9
0
 def test_mult_app_blocks_format(self):
     output = cli.format_application(self.apps)
     expected = "\n\n{block}\n\n{block}".format(
         block=cli.APPLICATION_TEMPLATE.format(self=self.apps[0]), )
     self.assertEqual(output, expected)
Esempio n. 10
0
 def test_single_app_blocks_format(self):
     output = cli.format_application(self.apps[0])
     expected = cli.APPLICATION_TEMPLATE.format(self=self.apps[0])
     self.assertEqual(output, expected)