Skip to content
Snippets Groups Projects
Select Git revision
  • 0b8f0c8b4b5a90e68d7569ef8f31f42faf854177
  • master default protected
  • dev protected
  • Issue/3003-stsInstitute
  • gitkeep
  • Issue/2449-GuidPidSlugToProjectSettings
  • Issue/2309-docs
  • Fix/xxxx-updateDependencies
  • Issue/2364-testingKpiParser
  • Issue/2287-guestRole
  • Test/xxxx-pipelineTriggers
  • Issue/2102-gitLabResTypeRCV
  • Issue/2278-gitlabToS
  • Issue/2101-gitLabResTypeUi
  • Issue/1788-extractionCronjob
  • Issue/2183-kpiGeneratorResource
  • Issue/2222-resourceDateCreated
  • Issue/2221-projectDateCreated
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1999-gitlabResourcesLib
  • Issue/1951-quotaImplementation
  • v2.22.0
  • v2.20.0
  • v2.19.1
  • v2.19.0
  • v2.18.0
  • v2.17.0
  • v2.16.2
  • v2.16.1
  • v2.16.0
  • v2.15.0
  • v2.14.0
  • v2.13.0
  • v2.12.1
  • v2.12.0
  • v2.11.1
  • v2.11.0
  • v2.10.1
  • v2.10.0
  • v2.9.1
  • v2.9.0
41 results

ProjectModel.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()