Ejemplo n.º 1
0
    def test_bottom_label_field_is_not_empty(self):
        """
        'bottom_label' field in graphmodel object is not empty
        """

        self.mock_lib.gwyfile_object_graphmodel_get.side_effect = (
            self._bottom_label_is_not_empty)
        meta = GwyGraphModel._get_meta(self.gwygraphmodel)
        self.assertEqual(meta['bottom_label'], "test bottom label")
Ejemplo n.º 2
0
    def test_y_unit_field_is_empty(self):
        """
        'y_unit' field in graphmodel object is empty
        """

        self.mock_lib.gwyfile_object_graphmodel_get.side_effect = (
            self._y_unit_is_empty)
        meta = GwyGraphModel._get_meta(self.gwygraphmodel)
        self.assertEqual(meta['y_unit'], '')
Ejemplo n.º 3
0
    def test_title_field_is_not_empty(self):
        """
        'title' field in graphmodel object is not empty
        """

        self.mock_lib.gwyfile_object_graphmodel_get.side_effect = (
            self._title_is_not_empty)
        meta = GwyGraphModel._get_meta(self.gwygraphmodel)
        self.assertEqual(meta['title'], "test title")
Ejemplo n.º 4
0
    def test_getting_number_of_curves(self):
        """
        Test getting number of curves from graphmodel object
        """

        self.mock_lib.gwyfile_object_graphmodel_get.side_effect = (
            self._get_number_of_curves)
        meta = GwyGraphModel._get_meta(self.gwygraphmodel)
        self.assertEqual(meta['ncurves'], 3)
Ejemplo n.º 5
0
    def test_y_max_set_is_false(self):
        """
        Check metadata dictionary if 'y_max_set' is False
        """

        self.mock_lib.gwyfile_object_graphmodel_get.side_effect = (
            self._y_max_set_is_false)
        meta = GwyGraphModel._get_meta(self.gwygraphmodel)
        self.assertIs(meta['y_max_set'], False)
        self.assertIsNone(meta['y_max'])
Ejemplo n.º 6
0
    def test_y_max_set_is_true(self):
        """
        Check metadata dictionary if 'y_max_set' is True
        """

        self.mock_lib.gwyfile_object_graphmodel_get.side_effect = (
            self._y_max_set_is_true)
        meta = GwyGraphModel._get_meta(self.gwygraphmodel)
        self.assertIs(meta['y_max_set'], True)
        self.assertEqual(meta['y_max'], 0.)
Ejemplo n.º 7
0
    def test_label_reverse_is_false(self):
        """
        'label.reverse' field is False
        """

        self.mock_lib.gwyfile_object_graphmodel_get.side_effect = (
            self._label_reverse)

        self.label_reverse = False

        meta = GwyGraphModel._get_meta(self.gwygraphmodel)
        self.assertIs(meta['label.reverse'], False)
Ejemplo n.º 8
0
    def test_label_has_frame_is_true(self):
        """
        'label.has_frame' field is True
        """

        self.mock_lib.gwyfile_object_graphmodel_get.side_effect = (
            self._label_has_frame)

        self.label_has_frame = True

        meta = GwyGraphModel._get_meta(self.gwygraphmodel)
        self.assertIs(meta['label.has_frame'], True)
Ejemplo n.º 9
0
    def test_y_is_logarithmic_false(self):
        """
        'y_is_logarithmic' field is False
        """

        self.mock_lib.gwyfile_object_graphmodel_get.side_effect = (
            self._y_is_logarithmic)

        self.y_is_logarithmic = False

        meta = GwyGraphModel._get_meta(self.gwygraphmodel)
        self.assertIs(meta['y_is_logarithmic'], False)
Ejemplo n.º 10
0
    def test_x_is_logarithmic_true(self):
        """
        'x_is_logarithmic' field is True
        """

        self.mock_lib.gwyfile_object_graphmodel_get.side_effect = (
            self._x_is_logarithmic)

        self.x_is_logarithmic = True

        meta = GwyGraphModel._get_meta(self.gwygraphmodel)
        self.assertIs(meta['x_is_logarithmic'], True)
Ejemplo n.º 11
0
    def test_grid_type(self):
        """
        Check 'grid-type' field in metadata dictionary
        """

        self.mock_lib.gwyfile_object_graphmodel_get.side_effect = (
            self._grid_type)

        self.grid_type = 1

        meta = GwyGraphModel._get_meta(self.gwygraphmodel)
        self.assertEqual(meta['grid-type'], self.grid_type)
Ejemplo n.º 12
0
    def test_label_position(self):
        """
        Check 'label.position' field in metadata dictionary
        """

        self.mock_lib.gwyfile_object_graphmodel_get.side_effect = (
            self._label_position)

        self.label_position = 1

        meta = GwyGraphModel._get_meta(self.gwygraphmodel)
        self.assertEqual(meta['label.position'], self.label_position)
Ejemplo n.º 13
0
    def test_label_frame_thickness(self):
        """
        Check 'label.frame_thickness' field in metadata dictionary
        """

        self.mock_lib.gwyfile_object_graphmodel_get.side_effect = (
            self._label_frame_thickness)

        self.label_frame_thickness = 1

        meta = GwyGraphModel._get_meta(self.gwygraphmodel)
        self.assertEqual(meta['label.frame_thickness'],
                         self.label_frame_thickness)