Skip to content
Snippets Groups Projects
Select Git revision
  • dd386d58b7def19a0078b3430b714b13847d2c1f
  • main default protected
  • feature/documentation_flight_mechanic_assessment
  • feature/updated_documentation_empennage_design
  • feature/updated_documentation_wing_design
  • feature/updated_documentation_weight_and_balance
  • feature/updated_engine_docu
  • feature/new_systems_methodology
  • fix/missing-API-documentation-for-python-modules
  • fix/missing-api-documentation
  • feature/python_example_folder_update
  • beta_release protected
  • fix/revert-gitlab-config
  • fix/citationEcologicalAssessment
  • documentation/styleupdate
  • feature/lightMode
  • documentation/create_mission_xml
  • 28-empennage-design-update-documentation-according-to-workshop
  • documentation/fix-dot-equations
  • documentation/propulsion-design-module
  • documentation/gitlab-workflow
  • 0.5.0
22 results

design_method.md

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