コード例 #1
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_mail_std2(self):
        """Function:  test_mail_std2

        Description:  Test with mail with standard format.

        Arguments:

        """

        gen_libs.print_dict(self.data2, mail=self.mail, no_std=True)
        self.assertEqual(self.mail.msg, self.msg2)
コード例 #2
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_set_ofile(self):
        """Function:  test_set_ofile

        Description:  Test with ofile argument.

        Arguments:

        """

        gen_libs.print_dict(self.data, ofile=self.ofile, no_std=True)

        self.assertTrue(os.path.isfile(self.ofile))
コード例 #3
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_mail_json2(self):
        """Function:  test_mail_json2

        Description:  Test with mail with JSON format.

        Arguments:

        """

        gen_libs.print_dict(self.data2,
                            mail=self.mail,
                            no_std=True,
                            json_fmt=True)
        self.assertEqual(self.mail.msg, self.msg)
コード例 #4
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_set_json(self):
        """Function:  test_set_json

        Description:  Test with json_fmt argument.

        Arguments:

        """

        gen_libs.print_dict(self.data,
                            ofile=self.ofile,
                            json_fmt=True,
                            no_std=True)

        self.assertTrue(filecmp.cmp(self.basefile, self.ofile))
コード例 #5
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_mail_json(self):
        """Function:  test_mail_json

        Description:  Test with mail and json_fmt arguments.

        Arguments:

        """

        gen_libs.print_dict(self.data2,
                            mail=self.mail,
                            json_fmt=True,
                            no_std=True)

        self.assertEqual(self.mail.msg, self.msg)
コード例 #6
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_non_dict(self):
        """Function:  test_non_dict

        Description:  Test with non-dictionary object.

        Arguments:

        """

        self.assertEqual(gen_libs.print_dict([1, 2, 3]),
                         (True, "Error: [1, 2, 3] -> Is not a dictionary"))
コード例 #7
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_set_default(self):
        """Function:  test_set_default

        Description:  Test with default settings.

        Arguments:

        """

        self.assertEqual(gen_libs.print_dict(self.data, no_std=True),
                         (False, None))
コード例 #8
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_set_no_std(self):
        """Function:  test_set_no_std

        Description:  Test with no_std argument.

        Arguments:

        """

        self.assertEqual(gen_libs.print_dict(self.data, no_std=True),
                         (False, None))
コード例 #9
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_mail_std(self):
        """Function:  test_mail_std

        Description:  Test with mail with standard format.

        Arguments:

        """

        self.assertEqual(
            gen_libs.print_dict(self.data, mail=self.mail, no_std=True),
            (False, None))
コード例 #10
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_set_ofile2(self):
        """Function:  test_set_ofile2

        Description:  Test with ofile argument.

        Arguments:

        """

        self.assertEqual(
            gen_libs.print_dict(self.data, ofile=self.ofile, no_std=True),
            (False, None))
コード例 #11
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_set_default(self, mock_prt, mock_std):
        """Function:  test_set_default

        Description:  Test with default settings.

        Arguments:

        """

        mock_prt.return_value = True
        mock_std.return_value = True

        self.assertEqual(gen_libs.print_dict(self.data), (False, None))
コード例 #12
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_set_ofile(self, mock_prt, mock_std):
        """Function:  test_set_ofile

        Description:  Test with ofile argument.

        Arguments:

        """

        mock_prt.return_value = True
        mock_std.return_value = True

        self.assertEqual(gen_libs.print_dict(self.data, ofile=self.ofile),
                         (False, None))
コード例 #13
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_set_nostd(self, mock_prt, mock_std):
        """Function:  test_set_nostd

        Description:  Test with no_std argument.

        Arguments:

        """

        mock_prt.return_value = True
        mock_std.return_value = True

        self.assertEqual(gen_libs.print_dict(self.data, no_std=self.no_std),
                         (False, None))
コード例 #14
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_mail_json(self):
        """Function:  test_mail_json

        Description:  Test with mail with JSON format.

        Arguments:

        """

        self.assertEqual(
            gen_libs.print_dict(self.data,
                                mail=self.mail,
                                no_std=True,
                                json_fmt=True), (False, None))
コード例 #15
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_ofile_json2(self):
        """Function:  test_ofile_json2

        Description:  Test with ofile and json_fmt arguments.

        Arguments:

        """

        self.assertEqual(
            gen_libs.print_dict(self.data,
                                ofile=self.ofile,
                                json_fmt=True,
                                no_std=True), (False, None))
コード例 #16
0
ファイル: print_dict.py プロジェクト: deepcoder42/python-lib
    def test_set_json(self, mock_prt, mock_std):
        """Function:  test_set_json

        Description:  Test with json_fmt argument.

        Arguments:

        """

        mock_prt.return_value = True
        mock_std.return_value = True

        self.assertEqual(
            gen_libs.print_dict(self.data, json_fmt=self.json_fmt),
            (False, None))