Added more tests including network tests

I added more test methods, including testing the face registration and interest methods. I used the gevent library (http://www.gevent.org) to run threads with two faces on localhost.

Alex,

Are you suggesting a change, or just asking why it was this way?

If it is functional and correct, I see no need to alter it.

Jeff

From: Adeola Bannis <notifications@github.com<mailto:notifications@github.com>>
Reply-To: named-data/PyNDN2 <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Mon, 16 Jun 2014 12:49:54 -0700
To: named-data/PyNDN2 <PyNDN2@noreply.github.com<mailto:PyNDN2@noreply.github.com>>
Subject: Re: [PyNDN2] Added more tests including network tests (#2)


In tests/unit_tests/test_face_methods.py:

> +    def face_process_events(self, face, callbacks, name=None):
> +        # implemented as a 'greenlet': something like a thread, but semi-synchronous
> +        # callbacks should be a list
> +        done = False
> +        while not done:
> +            face.processEvents()
> +            gevent.sleep(0.01)
> +            for c in callbacks:
> +
> +                if (c.call_count > 0):
> +                    done = True
> +
> +
> +
> +if __name__ == '__main__':
> +    suite = ut.TestLoader().loadTestsFromTestCase(TestFaceInterestMethods)


No, it's not strictly necessary, and it's not used by the Jenkins script anyway, since that runs through py.test.

If it bothers you, I can remove it.

—
Reply to this email directly or view it on GitHub<https://github.com/named-data/PyNDN2/pull/2/files#r13826589>.