Opened 5 years ago

Closed 5 years ago

#7874 closed enhancement (implemented)

add more unit tests for Controller

Reported by: robinson Owned by: atagar
Priority: Low Milestone:
Component: Core Tor/Stem Version:
Severity: Keywords: testing
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

This branch[0] begins adding more unit tests for Controller. Please pull this branch and I will add more tests later in a new branch (as time allows).

[0]: https://gitorious.org/stem-robinson/stem-robinson/commits/exp-controller-unit-tests-V1

Child Tickets

Change History (1)

comment:1 Changed 5 years ago by atagar

Resolution: implemented
Status: newclosed

Very nice additions. Thanks!

desc = "r %s %s u5lTXJKGsLKufRLnSyVqT7TdGYw 2012-12-30 22:02:49

You're setting quite a few fields so I'm not positive which is cleaner, but you might want to consider using the mocking module for this...

https://gitweb.torproject.org/stem.git/blob/HEAD:/test/mocking.py#l654

desc = mocking.get_router_status_entry_v2({
  "r": "%s %s u5lTXJKGsLKufRLnSyVqT7TdGYw 2012-12-30 22:02:49 77.223.43.54 9001 0" % (nickname, fingerprint),
  "s": "Fast Named Running Stable Valid",
  "w": "Bandwidth=75",
}, content = True}}
Note: See TracTickets for help on using tickets.