# Path: duct/sources/linux/basic.py
# class LoadAverage(Source):
# class DiskIO(Source):
# class CPU(Source):
# class Memory(Source):
# class DiskFree(Source):
# class Network(Source):
#     def _parse_loadaverage(self, data):
#     def get(self):
#     def sshGet(self):
#     def __init__(self, *a, **kw):
#     def _parse_stats(self, stats):
#     def sshGet(self):
#     def _getstats(self):
#     def get(self):
#     def __init__(self, *a):
#     def _read_proc_stat(self):
#     def _calculate_metrics(self, stat):
#     def _transpose_metrics(self, metrics, prefix):
#     def sshGet(self):
#     def get(self):
#     def _parse_stats(self, mem):
#     def get(self):
#     def sshGet(self):
#     def get(self):
#     def _parse_stats(self, stats):
#     def _readStats(self):
#     def sshGet(self):
#     def get(self):


from twisted.trial import unittest
from duct.sources.linux import basic
ZefHS5wV1KNZBK+vh08HvX/AY9WBHPH+DEbrpymn/9oAKVmhH+f73ADqVOanMPk0
-----END RSA PRIVATE KEY-----
"""

testKeyPassword = "testtest"

class FakeDuct(object):
    config = {
        'ssh_username': 'test', 
        'ssh_key': testKey,
        'ssh_keypass': testKeyPassword,
    }
    inter = 1.0
    ttl = 60.0
    hostConnectorCache = {}

class Tests(unittest.TestCase):
    def _qb(self, result):
        pass

    def test_ssh_source_setup(self):
        s = basic.LoadAverage({
                'service': 'mem',
                'use_ssh': True,
           }, self._qb, FakeDuct())

    def test_ssh_add_keyfile(self):
        with open('temp_key', 'wt') as f:
            f.write(testKey)


# Path: duct/sources/linux/basic.py
# class LoadAverage(Source):
# class DiskIO(Source):
# class CPU(Source):
# class Memory(Source):
# class DiskFree(Source):
# class Network(Source):
#     def _parse_loadaverage(self, data):
#     def get(self):
#     def sshGet(self):
#     def __init__(self, *a, **kw):
#     def _parse_stats(self, stats):
#     def sshGet(self):
#     def _getstats(self):
#     def get(self):
#     def __init__(self, *a):
#     def _read_proc_stat(self):
#     def _calculate_metrics(self, stat):
#     def _transpose_metrics(self, metrics, prefix):
#     def sshGet(self):
#     def get(self):
#     def _parse_stats(self, mem):
#     def get(self):
#     def sshGet(self):
#     def get(self):
#     def _parse_stats(self, stats):
#     def _readStats(self):
#     def sshGet(self):
#     def get(self):


# Path: duct/tests/test_ssh.py
from twisted.trial import unittest
from duct.sources.linux import basic

ZefHS5wV1KNZBK+vh08HvX/AY9WBHPH+DEbrpymn/9oAKVmhH+f73ADqVOanMPk0
-----END RSA PRIVATE KEY-----
"""

testKeyPassword = "testtest"

class FakeDuct(object):
    config = {
        'ssh_username': 'test', 
        'ssh_key': testKey,
        'ssh_keypass': testKeyPassword,
    }
    inter = 1.0
    ttl = 60.0
    hostConnectorCache = {}

class Tests(unittest.TestCase):
    def _qb(self, result):
        pass

    def test_ssh_source_setup(self):
        s = basic.LoadAverage({
                'service': 'mem',
                'use_ssh': True,
           }, self._qb, FakeDuct())

    def test_ssh_add_keyfile(self):
        with open('temp_key', 'wt') as f:
            f.write(testKey)


        s = basic.LoadAverage({