Пример #1
0
    def test_cpu_arch_name(self):
        """Test getting CPU arch name."""
        class MicroArch(object):
            def __init__(self, name):
                self.name = name

        st.HAVE_ARCHSPEC = True
        st.archspec_cpu_host = lambda: MicroArch('haswell')
        arch_name = get_cpu_arch_name()
        self.assertEqual(arch_name, 'haswell')

        st.archspec_cpu_host = lambda: None
        arch_name = get_cpu_arch_name()
        self.assertEqual(arch_name, 'UNKNOWN')
Пример #2
0
 def test_cpu_arch_name_native(self):
     """Test getting CPU arch name."""
     arch_name = get_cpu_arch_name()
     self.assertTrue(isinstance(arch_name, string_type))