예제 #1
0
파일: test_models.py 프로젝트: wong-j/scale
    def test_no_tags(self):
        """Tests calling get_data_type_tags() with no tags"""

        the_file = ScaleFile()
        tags = the_file.get_data_type_tags()

        self.assertSetEqual(tags, set())
예제 #2
0
파일: test_models.py 프로젝트: wong-j/scale
    def test_tags(self):
        """Tests calling get_data_type_tags() with tags"""

        the_file = ScaleFile(data_type='A,B,c')
        tags = the_file.get_data_type_tags()

        correct_set = set()
        correct_set.add('A')
        correct_set.add('B')
        correct_set.add('c')

        self.assertSetEqual(tags, correct_set)
예제 #3
0
파일: test_models.py 프로젝트: sau29/scale
    def test_same_tag(self):
        """Tests calling add_data_type_tag() with the same tag twice"""

        the_file = ScaleFile()
        the_file.add_data_type_tag('Hello-1')
        the_file.add_data_type_tag('Hello-1')
        tags = the_file.get_data_type_tags()

        correct_set = set()
        correct_set.add('Hello-1')

        self.assertSetEqual(tags, correct_set)
예제 #4
0
파일: test_models.py 프로젝트: wong-j/scale
    def test_valid(self):
        """Tests calling add_data_type_tag() with valid tags"""

        the_file = ScaleFile()
        the_file.add_data_type_tag('Hello-1')
        the_file.add_data_type_tag('foo_BAR')
        tags = the_file.get_data_type_tags()

        correct_set = set()
        correct_set.add('Hello-1')
        correct_set.add('foo_BAR')

        self.assertSetEqual(tags, correct_set)