1
0
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:
2016-08-19 18:54:22 +02:00
parent 4eac6820c5
commit 63f2d6fc11
83 changed files with 558 additions and 17194 deletions

33
tests/misc_test.py Normal file
View 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()