Exemplo n.º 1
0
 def test_bad_by_name_(self):
     employees = Employees(self.TEST_FILE)
     self.assertIsNotNone(employees)
     self.assertIsNone(employees.get_by_name('badname'))
Exemplo n.º 2
0
 def test_by_name(self):
     employees = Employees(self.TEST_FILE)
     self.assertIsNotNone(employees)
     self.assertEqual(440000, employees.get_by_name('frank'))
     self.assertEqual(560000, employees.get_by_name('jo'))
Exemplo n.º 3
0
    LOGGER.debug("infile ......................: %s", INFILE.name)
    LOGGER.debug("prog ........................: %s", PROG)
    LOGGER.debug("verbose .....................: %s", VERBOSE)
    LOGGER.debug("version .....................: %s", __version__)
    LOGGER.debug("employees ...................:")
    for n, t in E.employees.items():
        LOGGER.debug("\t%s\t%s", n, t)

    T = E.get_name(3)
    LOGGER.debug("name for id 3 ...............: %s", T)

    T = E.get_by_id(3)
    LOGGER.debug("turnover for 3 ..............: %i", T)

    T = E.get_by_name('frank')
    LOGGER.debug("turnover for frank ..........: %i", T)

    T = E.get_by_year(2012)
    LOGGER.debug("turnover for 2012 ...........: %i", T)

    T = list(E.list_by_id(3))
    LOGGER.debug("list turnover by id .........: %s", T)

    T = list(E.list_by_name('frank'))
    LOGGER.debug("list turnover by name .......: %s", T)

    T = list(E.list_by_year(2013))
    LOGGER.debug("list turnover by year .......: %s", T)

    if VERBOSE: