예제 #1
0
 def test_read_mod_and_etag_etag_only(self):
     etag_only_str = """
     {
       "_url": "https://repo.anaconda.com/pkgs/r/noarch",
       "info": {},
       "_etag": "\"569c0ecb-48\"",
       "packages": {}
     }
     """.strip()
     with temporary_content_in_file(etag_only_str) as path:
         mod_etag_dict = read_mod_and_etag(path)
         assert "_mod" not in mod_etag_dict
         assert mod_etag_dict["_etag"] == "\"569c0ecb-48\""
예제 #2
0
 def test_read_mod_and_etag_etag_only(self):
     etag_only_str = """
     {
       "_url": "https://repo.anaconda.com/pkgs/r/noarch",
       "info": {},
       "_etag": "\"569c0ecb-48\"",
       "packages": {}
     }
     """.strip()
     with temporary_content_in_file(etag_only_str) as path:
         mod_etag_dict = read_mod_and_etag(path)
         assert "_mod" not in mod_etag_dict
         assert mod_etag_dict["_etag"] == "\"569c0ecb-48\""
예제 #3
0
 def test_read_mod_and_etag_mod_etag(self):
     mod_etag_str = """
     {
       "_mod": "Sun, 17 Jan 2016 21:59:39 GMT",
       "_url": "https://repo.anaconda.com/pkgs/r/noarch",
       "info": {},
       "_etag": "\"569c0ecb-48\"",
       "packages": {}
     }
     """.strip()
     with temporary_content_in_file(mod_etag_str) as path:
         mod_etag_dict = read_mod_and_etag(path)
         assert mod_etag_dict["_mod"] == "Sun, 17 Jan 2016 21:59:39 GMT"
         assert mod_etag_dict["_etag"] == "\"569c0ecb-48\""
예제 #4
0
 def test_read_mod_and_etag_mod_etag(self):
     mod_etag_str = """
     {
       "_mod": "Sun, 17 Jan 2016 21:59:39 GMT",
       "_url": "https://repo.anaconda.com/pkgs/r/noarch",
       "info": {},
       "_etag": "\"569c0ecb-48\"",
       "packages": {}
     }
     """.strip()
     with temporary_content_in_file(mod_etag_str) as path:
         mod_etag_dict = read_mod_and_etag(path)
         assert mod_etag_dict["_mod"] == "Sun, 17 Jan 2016 21:59:39 GMT"
         assert mod_etag_dict["_etag"] == "\"569c0ecb-48\""
예제 #5
0
 def test_read_mod_and_etag_mod_only(self):
     mod_only_str = """
     {
       "_mod": "Wed, 14 Dec 2016 18:49:16 GMT",
       "_url": "https://conda.anaconda.org/conda-canary/noarch",
       "info": {
         "arch": null,
         "default_numpy_version": "1.7",
         "default_python_version": "2.7",
         "platform": null,
         "subdir": "noarch"
       },
       "packages": {}
     }
     """.strip()
     with temporary_content_in_file(mod_only_str) as path:
         mod_etag_dict = read_mod_and_etag(path)
         assert "_etag" not in mod_etag_dict
         assert mod_etag_dict["_mod"] == "Wed, 14 Dec 2016 18:49:16 GMT"
예제 #6
0
 def test_read_mod_and_etag_mod_only(self):
     mod_only_str = """
     {
       "_mod": "Wed, 14 Dec 2016 18:49:16 GMT",
       "_url": "https://conda.anaconda.org/conda-canary/noarch",
       "info": {
         "arch": null,
         "default_numpy_version": "1.7",
         "default_python_version": "2.7",
         "platform": null,
         "subdir": "noarch"
       },
       "packages": {}
     }
     """.strip()
     with temporary_content_in_file(mod_only_str) as path:
         mod_etag_dict = read_mod_and_etag(path)
         assert "_etag" not in mod_etag_dict
         assert mod_etag_dict["_mod"] == "Wed, 14 Dec 2016 18:49:16 GMT"