Skip to content

Commit

Permalink
Updates to get test_bsc.py to run
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce Lai committed Nov 20, 2019
1 parent aafd00c commit fe602ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ait/core/dmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import requests

import ait.core
from ait.core import log
from ait.core import cfg, log

GPS_Epoch = datetime.datetime(1980, 1, 6, 0, 0, 0)
TICs = [ ]
Expand Down
14 changes: 7 additions & 7 deletions ait/core/pcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
simple open, read, write, close functions
"""

import __builtin__
import builtins
import calendar
import math
import struct
import dmc
import datetime
import log

from .dmc import getTimestampUTC
from .log import info

"""
Check the endian of the host we are currently running on.
Expand Down Expand Up @@ -144,7 +144,7 @@ def __init__ (self, stream=None, swap=None, orig_len=0, maxlen=65535):
self._swap = swap

if stream is None:
self.ts_sec, self.ts_usec = dmc.getTimestampUTC()
self.ts_sec, self.ts_usec = getTimestampUTC()
self.incl_len = min(orig_len, maxlen)
self.orig_len = orig_len
self._data = str(self)
Expand Down Expand Up @@ -328,7 +328,7 @@ def close (self):
msg = 'Wrote %d bytes, %d packets, %d seconds to %s.'
self._stream.close()

log.info(msg % values)
info(msg % values)

self._filename = None
self._startTime = None
Expand Down Expand Up @@ -459,7 +459,7 @@ def open (filename, mode='r', **options):
options.get('nseconds', None),
options.get('dryrun' , False))
else:
stream = PCapStream( __builtin__.open(filename, mode), mode )
stream = PCapStream( builtins.open(filename, mode), mode )

return stream

Expand Down Expand Up @@ -488,7 +488,7 @@ def query(starttime, endtime, output=None, *filenames):

with open(output,'w') as outfile:
for filename in filenames:
log.info("pcap.query: processing %s..." % filename)
info("pcap.query: processing %s..." % filename)
with open(filename, 'r') as stream:
for header, packet in stream:
if packet is not None:
Expand Down
4 changes: 2 additions & 2 deletions ait/core/test/test_bsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

import datetime
import logging
import mock
import os
import platform
import socket
import time
from unittest import mock

import gevent
import nose
Expand Down Expand Up @@ -193,7 +193,7 @@ def test_handler_stat_dump(self, socket_mock):
handler['data_read'] = 27
stats = sl.dump_all_handler_stats()

print stats
print(stats)
assert len(stats) == 1
assert stats[0]['name'] == 'name'
assert stats[0]['reads'] == 2
Expand Down

0 comments on commit fe602ad

Please sign in to comment.