Skip to content
Snippets Groups Projects

Draft: Merge version0.1 changes into dev

Closed Hock, Martin requested to merge version0.1 into dev
5 files
+ 113
86
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 9
2
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
"""
Unittests for CreateID
'''
"""
import unittest
from create_id import create_id
class TestCreateID(unittest.TestCase):
"""
Class for all unittests of the create_id module.
"""
def test_existence(self):
"""Test if create_id returns a string."""
self.assertIsInstance(create_id(1), str)
self.assertIsInstance(create_id(2), str)
def test_errors(self):
""" Test if Errors are raised when id_method is wrong. """
with self.assertRaises(ValueError):
create_id(3)
with self.assertRaises(ValueError):
create_id('h')
def test_length(self):
""" Test if figure_id has the correct length. """
self.assertEqual(len(create_id(1)), 10)
self.assertEqual(len(create_id(2)), 8)
Loading