import os
import platform
import unittest

try:
    from android.os import Build
except ImportError:
    API_LEVEL = None
else:
    API_LEVEL = Build.VERSION.SDK_INT


class TestPsutil(unittest.TestCase):

    def test_disk(self):
        import psutil
        parts = psutil.disk_partitions(all=True)
        # See __ANDROID_API__ in patch. The native API was added on API 21, but doesn't work
        # until API 23.
        if API_LEVEL and (API_LEVEL < 23 or platform.architecture()[0] == "32bit"):
            self.assertFalse(parts)
        else:
            self.assertIn("/", [p.mountpoint for p in parts])

    def test_network(self):
        import psutil
        addrs = psutil.net_if_addrs()
        if API_LEVEL:
            self.assertFalse(addrs)
        else:
            self.assertIn("lo", addrs)

        self.assertIn("lo", psutil.net_if_stats())

    def test_process(self):
        import getpass
        import psutil
        self.assertIn(os.getpid(), psutil.pids())
        p = psutil.Process(os.getpid())
        self.assertEqual(getpass.getuser(), p.username())

@@ -613,260 +613,8 @@
 %5D)%0A%0A
-    def test_network(self):%0A        import psutil%0A        addrs = psutil.net_if_addrs()%0A        if API_LEVEL:%0A            self.assertFalse(addrs)%0A        else:%0A            self.assertIn(%22lo%22, addrs)%0A%0A        self.assertIn(%22lo%22, psutil.net_if_stats())%0A%0A
     

Remove psutil network test: Android 10 disables access to /proc/net