Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)

src/c/o/cogent-1.5.3/tests/test_parse/test_record.py   cogent(Download)
#!/usr/bin/env python
"""Unit tests for parser support libraries dealing with records.
"""
from cogent.parse.record import FieldError, RecordError, Grouper, \
    DelimitedSplitter, GenericRecord, MappedRecord, \
    def test_dict_adder(self):
        """dict_adder should add items to dict, creating if necessary"""
        d = dummy()
        dict_adder(d, 'x', 3)
        self.assertEqual(d.x, {3:None})
        dict_adder(d, 'x', 'ab')
        self.assertEqual(d.x, {3:None, 'a':'b'})
        dict_adder(d, 'x', ['a', 0])
        self.assertEqual(d.x, {3:None, 'a':0})
        dict_adder(d, 'y', None)

src/p/y/pycogent-HEAD/tests/test_parse/test_record.py   pycogent(Download)
#!/usr/bin/env python
"""Unit tests for parser support libraries dealing with records.
"""
from cogent.parse.record import FieldError, RecordError, Grouper, \
    DelimitedSplitter, GenericRecord, MappedRecord, \
    def test_dict_adder(self):
        """dict_adder should add items to dict, creating if necessary"""
        d = dummy()
        dict_adder(d, 'x', 3)
        self.assertEqual(d.x, {3:None})
        dict_adder(d, 'x', 'ab')
        self.assertEqual(d.x, {3:None, 'a':'b'})
        dict_adder(d, 'x', ['a', 0])
        self.assertEqual(d.x, {3:None, 'a':0})
        dict_adder(d, 'y', None)