import re
import shutil
import socket
-import StringIO
import sys
import uuid
def _output_hosts_file(self):
"""Writes a dnsmasq compatible hosts file."""
r = re.compile('[:.]')
- buf = StringIO.StringIO()
+ buf = six.StringIO()
for port in self.network.ports:
for alloc in port.fixed_ips:
"""Test of Policy Engine For Neutron"""
import json
-import StringIO
import urllib2
import fixtures
import mock
+import six
import neutron
from neutron.api.v2 import attributes
def test_enforce_http_true(self):
def fakeurlopen(url, post_data):
- return StringIO.StringIO("True")
+ return six.StringIO("True")
with mock.patch.object(urllib2, 'urlopen', new=fakeurlopen):
action = "example:get_http"
def test_enforce_http_false(self):
def fakeurlopen(url, post_data):
- return StringIO.StringIO("False")
+ return six.StringIO("False")
with mock.patch.object(urllib2, 'urlopen', new=fakeurlopen):
action = "example:get_http"