# Path: oppy/path/path.py
# DEFAULT_BWWEIGHTSCALE = 10000
# def getPath(netstatus, guard_manager, exit_request=None, fast=True,
#             stable=True, internal=False):
# def selectExitNode(bw_weights, bwweightscale, cons_rel_stats, descriptors,
#                    fast, stable, internal, port):
# def selectGuardNode(cons_rel_stats, descriptors, guards, fast, stable,
#                     exit_desc, exit_status_entry):
# def selectMiddleNode(bw_weights, bwweightscale, cons_rel_stats, descriptors,
#                      fast, stable, exit_desc, exit_status_entry, guard_desc,
#                      guard_status_entry):
# def filterExits(cons_rel_stats, descriptors, fast, stable, internal, port):
# def filterMiddles(cons_rel_stats, descriptors, fast, stable, exit_desc,
#                   exit_status_entry, guard_desc, guard_status_entry):
# def exitFilter(exit_fprint, cons_rel_stats, descriptors, fast, stable,
#                internal, port):
# def guardFilter(guard, cons_rel_stats, descriptors, fast, stable, exit_desc,
#                 exit_status_entry):
# def middleFilter(node, cons_rel_stats, descriptors, exit_desc,
#                  exit_status_entry, guard_desc, guard_status_entry,
#                  fast=False, stable=False):
# 
# Path: oppy/path/util.py
# def nodeUsableWithOther(desc1, status_entry1, desc2, status_entry2):
# def selectWeightedNode(weighted_nodes):
# def getWeightedNodes(nodes, weights):
# def getPositionWeights(nodes, cons_rel_stats, position, bw_weights,
#                        bwweightscale):
# def getBwweight(flags, position, bw_weights):
# def inSameFamily(desc1, status_entry1, desc2, status_entry2):
# def inSame16Subnet(status_entry1, status_entry2):
# 
# Path: oppy/path/exceptions.py
# class NoUsableGuardsException(Exception):
#     pass


import mock
from stem import Flag
from twisted.internet import defer
from twisted.trial import unittest
from oppy.path import path
from oppy.path import util as path_util
from oppy.path.exceptions import NoUsableGuardsException

        _ = path.selectGuardNode(
            cons_rel_stats,
            descriptors,
            guards,
            fast,
            stable,
            exit_desc,
            exit_status_entry)

        mock_gf.assert_called_once_with(
            'guard',
            cons_rel_stats,
            descriptors,
            fast,
            stable,
            exit_desc,
            exit_status_entry)

        mock_rc.assert_called_once_with(['guard'])

    def test_selectGuardNode_no_guards(self):
        cons_rel_stats = 'cons_rel_stats'
        descriptors = 'descriptors'
        guards = []
        fast = 'fast'
        stable = 'stable'
        exit_desc = 'exit_desc'
        exit_status_entry = 'exit_status_entry'


# Path: oppy/path/path.py
# DEFAULT_BWWEIGHTSCALE = 10000
# def getPath(netstatus, guard_manager, exit_request=None, fast=True,
#             stable=True, internal=False):
# def selectExitNode(bw_weights, bwweightscale, cons_rel_stats, descriptors,
#                    fast, stable, internal, port):
# def selectGuardNode(cons_rel_stats, descriptors, guards, fast, stable,
#                     exit_desc, exit_status_entry):
# def selectMiddleNode(bw_weights, bwweightscale, cons_rel_stats, descriptors,
#                      fast, stable, exit_desc, exit_status_entry, guard_desc,
#                      guard_status_entry):
# def filterExits(cons_rel_stats, descriptors, fast, stable, internal, port):
# def filterMiddles(cons_rel_stats, descriptors, fast, stable, exit_desc,
#                   exit_status_entry, guard_desc, guard_status_entry):
# def exitFilter(exit_fprint, cons_rel_stats, descriptors, fast, stable,
#                internal, port):
# def guardFilter(guard, cons_rel_stats, descriptors, fast, stable, exit_desc,
#                 exit_status_entry):
# def middleFilter(node, cons_rel_stats, descriptors, exit_desc,
#                  exit_status_entry, guard_desc, guard_status_entry,
#                  fast=False, stable=False):
# 
# Path: oppy/path/util.py
# def nodeUsableWithOther(desc1, status_entry1, desc2, status_entry2):
# def selectWeightedNode(weighted_nodes):
# def getWeightedNodes(nodes, weights):
# def getPositionWeights(nodes, cons_rel_stats, position, bw_weights,
#                        bwweightscale):
# def getBwweight(flags, position, bw_weights):
# def inSameFamily(desc1, status_entry1, desc2, status_entry2):
# def inSame16Subnet(status_entry1, status_entry2):
# 
# Path: oppy/path/exceptions.py
# class NoUsableGuardsException(Exception):
#     pass


# Path: oppy/tests/unit/path/test_path.py
import mock
from stem import Flag
from twisted.internet import defer
from twisted.trial import unittest
from oppy.path import path
from oppy.path import util as path_util
from oppy.path.exceptions import NoUsableGuardsException


        _ = path.selectGuardNode(
            cons_rel_stats,
            descriptors,
            guards,
            fast,
            stable,
            exit_desc,
            exit_status_entry)

        mock_gf.assert_called_once_with(
            'guard',
            cons_rel_stats,
            descriptors,
            fast,
            stable,
            exit_desc,
            exit_status_entry)

        mock_rc.assert_called_once_with(['guard'])

    def test_selectGuardNode_no_guards(self):
        cons_rel_stats = 'cons_rel_stats'
        descriptors = 'descriptors'
        guards = []
        fast = 'fast'
        stable = 'stable'
        exit_desc = 'exit_desc'
        exit_status_entry = 'exit_status_entry'


        self.assertRaises(NoUsableGuardsException,