Well, a network is usually made up of two or more nodes, and a node is a system that originates, routes or terminates data. While you might have a switch or router as part of your local network, these devices do not originate or terminate (usefully) much data themselves. Furthermore, while you can make a linux system a member of multiple networks, inherently, it becomes directly connected to each separate network, such that any attempt to establish a network connection from one network address to another network address that exist on the same host would, by design, be routed by the operating system kernel back to itself before it even made it to a NIC.
There are ways to trick a system into not being able to tell that it's connecting back to itself, but these tricks require the participation of a remote router or system to perform a network address translation of a kind that isn't commonly found on small office/home office networking devices, although linux can do it, but not by itself on one system without encountering the inherent problems I mentioned above.
The main problem, however, is that your requirement to 'test the network', is not defined. What network are you trying to test? Is it your networking code? To my knowledge, if your code will send and receive data over the loopback address (127.0.0.1), in a way that does not concern itself with low-level networking attributes such as packet size, or flow rates and the like, then it will also work between two separate hosts that have the same code base. However, if the networking you wish to test encompasses more than code, then you have to define of what exactly that network consists, and for most foreseeable scenarios, there'll have to be a second system (a linux box is probably the least expensive) to broker the far end of the test network.