Exemple #1
0
    def test_add_unit(self):
        try:
            add_unit('ft', '20*m')
        except KeyError as err:
            self.assertEqual(
                err.args[0], "Unit 'ft' already defined with different factor or powers.")
        else:
            self.fail("Expecting Key Error")

        try:
            add_offset_unit('degR', 'degK', 20, 10)
        except KeyError as err:
            self.assertEqual(
                err.args[0], "Unit 'degR' already defined with different factor or powers.")
        else:
            self.fail("Expecting Key Error")
Exemple #2
0
    def test_add_unit(self):
        try:
            add_unit('ft', '20*m')
        except KeyError as err:
            self.assertEqual(
                str(err), "'Unit ft already defined with different factor or powers'")
        else:
            self.fail("Expecting Key Error")

        try:
            add_offset_unit('degR', 'degK', 20, 10)
        except KeyError as err:
            self.assertEqual(
                str(err), "'Unit degR already defined with different factor or powers'")
        else:
            self.fail("Expecting Key Error")
Exemple #3
0
    def test_add_unit(self):
        try:
            add_unit('ft', '20*m')
        except KeyError as err:
            self.assertEqual(
                str(err),
                "'Unit ft already defined with different factor or powers'")
        else:
            self.fail("Expecting Key Error")

        try:
            add_offset_unit('degR', 'degK', 20, 10)
        except KeyError as err:
            self.assertEqual(
                str(err),
                "'Unit degR already defined with different factor or powers'")
        else:
            self.fail("Expecting Key Error")