Example #1
0
 def test_empty_linux_distribution(self):
     # If platform.linux_distribution returns a tuple of empty
     # strings, as it does on Windows and Mac OS X, we fall back to
     # the result of platform.system().
     self._set_platform(('', '', ''), 'BarOS')
     self._set_hostname("bar")
     consumer = oauth.SystemWideConsumer("app name")
     self.assertEquals(consumer.key, 'System-wide: BarOS (bar)')
Example #2
0
 def test_broken_linux_distribution(self):
     # If platform.linux_distribution raises an exception (which
     # can happen with older versions of Python), we fall back to
     # the result of platform.system().
     self._set_platform(self._broken, 'BazOS')
     self._set_hostname("baz")
     consumer = oauth.SystemWideConsumer("app name")
     self.assertEquals(consumer.key, 'System-wide: BazOS (baz)')
Example #3
0
 def test_useful_linux_distribution(self):
     # If platform.linux_distribution returns a tuple of useful
     # strings, as it does on Ubuntu, we'll use the first string
     # for the system type.
     self._set_platform(('Fooix', 'String2', 'String3'), 'FooOS')
     self._set_hostname("foo")
     consumer = oauth.SystemWideConsumer("app name")
     self.assertEquals(consumer.key, 'System-wide: Fooix (foo)')