mirror of
https://github.com/gryf/pygtktalog.git
synced 2025-12-17 11:30:19 +01:00
Clean up old files. Repair unit tests
This commit is contained in:
33
tests/misc_test.py
Normal file
33
tests/misc_test.py
Normal file
@@ -0,0 +1,33 @@
|
||||
"""
|
||||
Project: pyGTKtalog
|
||||
Description: Tests for misc functions.
|
||||
Type: test
|
||||
Author: Roman 'gryf' Dobosz, gryf73@gmail.com
|
||||
Created: 2009-04-09
|
||||
"""
|
||||
import unittest
|
||||
import os
|
||||
|
||||
import pygtktalog.misc as pgtkmisc
|
||||
|
||||
|
||||
class TestMiscModule(unittest.TestCase):
|
||||
"""
|
||||
Tests functions from misc module
|
||||
"""
|
||||
|
||||
def test_float_to_string(self):
|
||||
"""
|
||||
test conversion between digits to formated output
|
||||
"""
|
||||
self.assertEqual(pgtkmisc.float_to_string(10), '00:00:10')
|
||||
self.assertEqual(pgtkmisc.float_to_string(76), '00:01:16')
|
||||
self.assertEqual(pgtkmisc.float_to_string(22222), '06:10:22')
|
||||
self.assertRaises(TypeError, pgtkmisc.float_to_string)
|
||||
self.assertRaises(TypeError, pgtkmisc.float_to_string, None)
|
||||
self.assertRaises(TypeError, pgtkmisc.float_to_string, '10')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.chdir(os.path.join(os.path.abspath(os.path.dirname(__file__)), "../"))
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user