Ejemplo n.º 1
0
    def test_get_metadata(self):
        m = get_metadata(os.path.join(CURRENT_DIR, 'sample', 'dir1'))
        self.assertEqual(m['title'], 'An example gallery')
        self.assertEqual(m['representative'], 'test1.jpg')

        m = get_metadata(os.path.join(CURRENT_DIR, 'sample', 'dir1', 'test'))
        self.assertEqual(m['title'], 'Test')
Ejemplo n.º 2
0
def test_get_metadata():
    "Test the get_metadata function."

    m = get_metadata(os.path.join(SAMPLE_DIR, 'pictures', 'dir1'))
    assert m['title'] == REF['dir1']['title']
    assert m['thumbnail'] == ''

    m = get_metadata(os.path.join(SAMPLE_DIR, 'pictures', 'dir2'))
    assert m['title'] == REF['dir2']['title']
    assert m['thumbnail'] == REF['dir2']['thumbnail']