예제 #1
0
    def test_indent_multi_dict(self):

        """Function:  test_indent_multi_dict

        Description:  Test multi dict with indentation.

        Arguments:

        """

        gen_libs.prt_dict(self.data3, self.fname, indent=self.indent2)
        self.fname.close()

        self.assertTrue(filecmp.cmp(self.basefile5, self.ofile))
예제 #2
0
    def test_multi_dict(self):

        """Function:  test_multi_dict

        Description:  Test with multiple items in dictionary.

        Arguments:

        """

        gen_libs.prt_dict(self.data3, self.fname)
        self.fname.close()

        self.assertTrue(filecmp.cmp(self.basefile2, self.ofile))
예제 #3
0
    def test_multi_lvl(self):

        """Function:  test_multi_lvl

        Description:  Test with multiple level dictionary.

        Arguments:

        """

        gen_libs.prt_dict(self.data4, self.fname)
        self.fname.close()

        self.assertTrue(filecmp.cmp(self.basefile3, self.ofile))
예제 #4
0
    def test_indent(self):

        """Function:  test_indent

        Description:  Test with passing indentation setting.

        Arguments:

        """

        gen_libs.prt_dict(self.data2, self.fname, indent=self.indent)
        self.fname.close()

        self.assertTrue(filecmp.cmp(self.basefile, self.ofile))
예제 #5
0
    def test_empty_dict(self):

        """Function:  test_empty_dict

        Description:  Test with empty dictionary.

        Arguments:

        """

        self.assertFalse(gen_libs.prt_dict(self.data))
예제 #6
0
    def test_one_item(self):

        """Function:  test_one_item

        Description:  Test with one item in dictionary.

        Arguments:

        """

        self.assertFalse(gen_libs.prt_dict(self.data2, self.fname))
        self.fname.close()

        self.assertTrue(filecmp.cmp(self.basefile, self.ofile))