Example #1
0
    def test_configuration(self):
        fp = os.path.join(TEST_DATA_DIR, "Lenna.png")
        default_config = DataFileElement.get_default_config()
        ntools.assert_equal(default_config, {'filepath': None})

        default_config['filepath'] = fp
        inst1 = DataFileElement.from_config(default_config)
        ntools.assert_equal(default_config, inst1.get_config())

        inst2 = DataFileElement.from_config(inst1.get_config())
        ntools.assert_equal(inst1, inst2)
Example #2
0
    def test_configuration(self):
        fp = os.path.join(TEST_DATA_DIR, "Lenna.png")
        default_config = DataFileElement.get_default_config()
        ntools.assert_equal(default_config, {"filepath": None})

        default_config["filepath"] = fp
        inst1 = DataFileElement.from_config(default_config)
        ntools.assert_equal(default_config, inst1.get_config())

        inst2 = DataFileElement.from_config(inst1.get_config())
        ntools.assert_equal(inst1, inst2)
Example #3
0
    def test_configuration(self):
        fp = os.path.join(TEST_DATA_DIR, "Lenna.png")
        default_config = DataFileElement.get_default_config()
        self.assertEqual(default_config,
                         {'filepath': None, 'readonly': False,
                          'explicit_mimetype': None})

        default_config['filepath'] = fp
        inst1 = DataFileElement.from_config(default_config)
        self.assertEqual(default_config, inst1.get_config())

        inst2 = DataFileElement.from_config(inst1.get_config())
        self.assertEqual(inst1, inst2)
Example #4
0
    def test_configuration(self):
        fp = os.path.join(TEST_DATA_DIR, "Lenna.png")
        default_config = DataFileElement.get_default_config()
        self.assertEqual(default_config, {
            'filepath': None,
            'readonly': False,
            'explicit_mimetype': None
        })

        default_config['filepath'] = fp
        inst1 = DataFileElement.from_config(default_config)
        self.assertEqual(default_config, inst1.get_config())

        inst2 = DataFileElement.from_config(inst1.get_config())
        self.assertEqual(inst1, inst2)
Example #5
0
 def test_fromConfig(self):
     fp = os.path.join(TEST_DATA_DIR, "Lenna.png")
     c = {
         "filepath": fp
     }
     df = DataFileElement.from_config(c)
     ntools.assert_equal(df._filepath, fp)
Example #6
0
 def test_fromConfig(self):
     fp = os.path.join(TEST_DATA_DIR, "Lenna.png")
     c = {
         "filepath": fp
     }
     #: :type: DataFileElement
     df = DataFileElement.from_config(c)
     self.assertEqual(df._filepath, fp)
Example #7
0
 def test_fromConfig(self):
     fp = os.path.join(TEST_DATA_DIR, "Lenna.png")
     c = {"filepath": fp}
     df = DataFileElement.from_config(c)
     ntools.assert_equal(df._filepath, fp)
Example #8
0
 def test_fromConfig(self):
     fp = os.path.join(TEST_DATA_DIR, "Lenna.png")
     c = {"filepath": fp}
     #: :type: DataFileElement
     df = DataFileElement.from_config(c)
     self.assertEqual(df._filepath, fp)