~mvo/software-center/region-whitelist-5.2

« back to all changes in this revision

Viewing changes to test/test_utils.py

* lp:~mvo/software-center/oem-descriptor-in-user-agent-5.2:
  - include the oem-channel descriptor in the custom user agent
    string (LP: #1042749)

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
from testutils import setup_test_env
17
17
setup_test_env()
 
18
 
18
19
from softwarecenter.utils import (decode_xml_char_reference,
19
20
                                  release_filename_in_lists_from_deb_line,
20
21
                                  get_http_proxy_string_from_libproxy,
21
22
                                  get_file_path_from_iconname,
 
23
                                  get_oem_channel_descriptor,
22
24
                                  )
23
25
from softwarecenter.testutils import (do_events,
24
26
                                      get_test_gtk3_icon_cache,
284
286
        # ensure that the second one was not called
285
287
        self.assertEqual(len(glob.glob(os.path.join(tmpdir, "marker.*"))), 1)
286
288
 
 
289
    def test_oem_channel_extractor(self):
 
290
        s = get_oem_channel_descriptor("./data/ubuntu_dist_channel")
 
291
        self.assertEqual(s, "canonical-oem-watauga-precise-amd64-20120517-2")
 
292
 
287
293
 
288
294
 
289
295
if __name__ == "__main__":