Skip to content
Snippets Groups Projects
Select Git revision
  • aef42a773666470cca577671d24a5eb09ffb2248
  • master default protected
  • dev protected
  • Issue/3189-onboardingUniBonn
  • Issue/3130-onboardingUzK
  • Issue/3109-onboarding
  • Issue/2915-migrateSql2Linked
  • test_ci
  • Issue/xxxx-fixDevcontainer
  • Issue/xxxx-generateLatestTag
  • Issue/2980-fixContainerBuild
  • Issue/2967-fixGD
  • Issue/2944-gdShenanigans
  • Issue/2906-containerCron
  • Issue/2880-gd
  • petar.hristov-master-patch-9e49
  • Issue/2668-graphDeployer
  • gitkeep
  • Hotfix/xxxx-fastDeployment
  • Hotfix/2615-graphDeployerLag
  • Issue/2568-betterLogging
  • v2.2.0
  • v2.1.11
  • v2.1.10
  • v2.1.9
  • v2.1.8
  • v2.1.7
  • v2.1.6
  • v2.1.5
  • v2.1.4
  • v2.1.3
  • v2.1.2
  • v2.1.1
  • v2.1.0
  • v2.0.1
  • v2.0.0
  • v1.2.11
  • v1.2.10
  • v1.2.9
  • v1.2.8
  • v1.2.7
41 results

AssemblyInfo.cs

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    test_create_id.py 929 B
    #!/usr/bin/env python3
    # -*- coding: utf-8 -*-
    """
    Unittests for create_id
    """
    
    import unittest
    import plotid.create_id as cid
    
    
    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(cid.create_id('time'), str)
            self.assertIsInstance(cid.create_id('random'), str)
    
        def test_errors(self):
            """ Test if Errors are raised when id_method is wrong. """
            with self.assertRaises(ValueError):
                cid.create_id(3)
            with self.assertRaises(ValueError):
                cid.create_id('h')
    
        def test_length(self):
            """ Test if figure_id has the correct length. """
            self.assertEqual(len(cid.create_id('time')), 10)
            self.assertEqual(len(cid.create_id('random')), 8)
    
    
    if __name__ == '__main__':
        unittest.main()