def testDump(self):

        testsForDump = self._getTestsForDump();

        for yaml, value in testsForDump.items():
            self.assertEqual(yaml, Inline.dump(value), '::dump() converts a PHP structure to an inline YAML ({0})'.format(yaml));


        for yaml, value in self._getTestsForParse().items():
            self.assertEqual(value, Inline.parse(Inline.dump(value)), 'check consistency');


        for yaml, value in testsForDump.items():
            self.assertEqual(value, Inline.parse(Inline.dump(value)), 'check consistency');
Exemple #2
0
    def testDump(self):

        testsForDump = self._getTestsForDump()

        for yaml, value in testsForDump.items():
            self.assertEqual(
                yaml, Inline.dump(value),
                '::dump() converts a PHP structure to an inline YAML ({0})'.
                format(yaml))

        for yaml, value in self._getTestsForParse().items():
            self.assertEqual(value, Inline.parse(Inline.dump(value)),
                             'check consistency')

        for yaml, value in testsForDump.items():
            self.assertEqual(value, Inline.parse(Inline.dump(value)),
                             'check consistency')
    def testHashStringsResemblingExponentialNumericsShouldNotBeChangedToINF(self):

        value = '686e444';

        self.assertEqual(value, Inline.parse(Inline.dump(value)));
    def testDumpNumericValueWithLocale(self):

        self.assertEqual('1.2', Inline.dump(1.2));
Exemple #5
0
    def testHashStringsResemblingExponentialNumericsShouldNotBeChangedToINF(
            self):

        value = '686e444'

        self.assertEqual(value, Inline.parse(Inline.dump(value)))
Exemple #6
0
    def testDumpNumericValueWithLocale(self):

        self.assertEqual('1.2', Inline.dump(1.2))