Exemplo n.º 1
0
    def test_isInt_not_a_number(self):
        # Arrange
        not_a_number = "a"

        # Act
        ret = SpiderImagePlugin.isInt(not_a_number)

        # Assert
        self.assertEqual(ret, 0)
Exemplo n.º 2
0
    def test_isInt_not_a_number(self):
        # Arrange
        not_a_number = "a"

        # Act
        ret = SpiderImagePlugin.isInt(not_a_number)

        # Assert
        self.assertEqual(ret, 0)
Exemplo n.º 3
0
    def test_loadImageSeries_no_input(self):
        # Arrange
        file_list = None

        # Act
        img_list = SpiderImagePlugin.loadImageSeries(file_list)

        # Assert
        self.assertIsNone(img_list)
Exemplo n.º 4
0
def test_is_int_not_a_number():
    # Arrange
    not_a_number = "a"

    # Act
    ret = SpiderImagePlugin.isInt(not_a_number)

    # Assert
    assert ret == 0
Exemplo n.º 5
0
    def test_loadImageSeries_no_input(self):
        # Arrange
        file_list = None

        # Act
        img_list = SpiderImagePlugin.loadImageSeries(file_list)

        # Assert
        self.assertEqual(img_list, None)
Exemplo n.º 6
0
def test_load_image_series_no_input():
    # Arrange
    file_list = None

    # Act
    img_list = SpiderImagePlugin.loadImageSeries(file_list)

    # Assert
    assert img_list is None
Exemplo n.º 7
0
    def test_loadImageSeries(self):
        # Arrange
        not_spider_file = "Tests/images/hopper.ppm"
        file_list = [TEST_FILE, not_spider_file, "path/not_found.ext"]

        # Act
        img_list = SpiderImagePlugin.loadImageSeries(file_list)

        # Assert
        self.assertEqual(len(img_list), 1)
        self.assertIsInstance(img_list[0], Image.Image)
        self.assertEqual(img_list[0].size, (128, 128))
Exemplo n.º 8
0
    def test_loadImageSeries(self):
        # Arrange
        not_spider_file = "Tests/images/hopper.ppm"
        file_list = [TEST_FILE, not_spider_file, "path/not_found.ext"]

        # Act
        img_list = SpiderImagePlugin.loadImageSeries(file_list)

        # Assert
        self.assertEqual(len(img_list), 1)
        self.assertIsInstance(img_list[0], Image.Image)
        self.assertEqual(img_list[0].size, (128, 128))
Exemplo n.º 9
0
def test_load_image_series():
    # Arrange
    not_spider_file = "Tests/images/hopper.ppm"
    file_list = [TEST_FILE, not_spider_file, "path/not_found.ext"]

    # Act
    img_list = SpiderImagePlugin.loadImageSeries(file_list)

    # Assert
    assert len(img_list) == 1
    assert isinstance(img_list[0], Image.Image)
    assert img_list[0].size == (128, 128)
Exemplo n.º 10
0
 def test_isSpiderImage(self):
     self.assertTrue(SpiderImagePlugin.isSpiderImage(TEST_FILE))
Exemplo n.º 11
0
 def test_isSpiderImage(self):
     self.assertTrue(SpiderImagePlugin.isSpiderImage(TEST_FILE))
Exemplo n.º 12
0
def test_is_spider_image():
    assert SpiderImagePlugin.isSpiderImage(TEST_FILE)
Exemplo n.º 13
0
def test_isSpiderImage():
    assert_true(SpiderImagePlugin.isSpiderImage(test_file))
Exemplo n.º 14
0
 def test_isSpiderImage(self):
     self.assertTrue(SpiderImagePlugin.isSpiderImage(test_file))