This repository was archived by the owner on Sep 12, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,9 @@ def get_tags(namespace, repository):
7070 if not full_tag_name .startswith ('tag_' ):
7171 continue
7272 tag_name = full_tag_name [4 :]
73- tag_content = store .get_content (fname )
73+ tag_content = store .get_content (
74+ store .tag_path (namespace , repository , tag_name )
75+ )
7476 yield (tag_name , tag_content )
7577
7678
Original file line number Diff line number Diff line change @@ -112,3 +112,28 @@ def test_debug_key(self):
112112
113113 # We don't call self._storage.remove(filename) here to ensure tearDown
114114 # cleanup properly and that other tests keep running as expected.
115+
116+ # Validation test for docker-index#486
117+ def test_get_tags (self ):
118+ store = self ._storage
119+ store ._root_path = 'my/custom/path'
120+ store ._init_path ()
121+ assert store ._root_path == 'my/custom/path'
122+ tag_path = store .tag_path ('test' , 'test' , '0.0.2' )
123+ store .put_content (tag_path , 'randomdata' )
124+ tags_path = store .tag_path ('test' , 'test' )
125+ for fname in store .list_directory (tags_path ):
126+ full_tag_name = fname .split ('/' ).pop ()
127+ if not full_tag_name == 'tag_0.0.2' :
128+ continue
129+ try :
130+ store .get_content (fname )
131+ except exceptions .FileNotFoundError :
132+ pass
133+ except Exception as e :
134+ raise e
135+ else :
136+ assert False
137+
138+ tag_content = store .get_content (tag_path )
139+ assert tag_content == 'randomdata'
You can’t perform that action at this time.
0 commit comments