aboutsummaryrefslogtreecommitdiff
path: root/src/argaze.test/ArGazeProject.py
blob: f37e1f51e07203bbb8e5dccd09f9d3a790b3b58c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python

import unittest
import os

from argaze import ArGazeProject


class TestArGazeProjectClass(unittest.TestCase):
    """Test ArGazeProject class."""

    def test_from_json(self):
        """Test ArGazeProject creation from json file."""
        
        # Edit project file path
        current_directory = os.path.dirname(os.path.abspath(__file__))
        json_filepath = os.path.join(current_directory, 'utils/project.json')

        # Load project
        argaze_project = ArGazeProject.ArGazeProject.from_json(json_filepath)

        # Check project meta data
        self.assertEqual(argaze_project.name, "TestProject")

        # Check ArUco camera
        print(argaze_project.aruco_camera)
        self.assertEqual(argaze_project.aruco_camera.rms, 0.)

if __name__ == '__main__':

    unittest.main()