Welcome Guest, Not a member yet? Register   Sign In
Unit testing, code coverage, and undefined functions
#4

> wondering if this is an instance where it would be appropriate to let it be less than 100%.

I think it would be appropriate.
Because we can't test a function which does not exists, and probably you don't have to
test `getallheaders()`.

But if you want to get 100% coverage for the class, you can get it:
1. move `_get_request_headers()` method to another class
2. replace the object which calls `getallheaders()` with an mock object only when you run test.
Reply


Messages In This Thread
RE: Unit testing, code coverage, and undefined functions - by kenjis - 07-29-2017, 05:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB