aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/sms.py
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-04-10 20:46:07 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-04-11 19:15:56 +0200
commite1a58bd8ddaa4afb1f6de80d165f4561cb44de60 (patch)
tree6671f3cf389b766cc91111a3b5f173e7fad26ca5 /src/osmo_gsm_tester/sms.py
parente8bbcbf5b8f3fd456b17595fd6ea22ce031b5427 (diff)
Move object classes used by tests into obj/ subdir
Diffstat (limited to 'src/osmo_gsm_tester/sms.py')
-rw-r--r--src/osmo_gsm_tester/sms.py55
1 files changed, 0 insertions, 55 deletions
diff --git a/src/osmo_gsm_tester/sms.py b/src/osmo_gsm_tester/sms.py
deleted file mode 100644
index 0118517..0000000
--- a/src/osmo_gsm_tester/sms.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# osmo_gsm_tester: DBUS client to talk to ofono
-#
-# Copyright (C) 2016-2017 by sysmocom - s.f.m.c. GmbH
-#
-# Author: Neels Hofmeyr <neels@hofmeyr.de>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-class Sms:
- _last_sms_idx = 0
-
- def __init__(self, src_msisdn=None, dst_msisdn=None, *tokens):
- Sms._last_sms_idx += 1
- self._src_msisdn = src_msisdn
- self._dst_msisdn = dst_msisdn
- msgs = ['message nr. %d' % Sms._last_sms_idx]
- msgs.extend(tokens)
- if src_msisdn:
- msgs.append('from %s' % src_msisdn)
- if dst_msisdn:
- msgs.append('to %s' % dst_msisdn)
- self.msg = ', '.join(msgs)
-
- def __str__(self):
- return self.msg
-
- def __repr__(self):
- return repr(self.msg)
-
- def __eq__(self, other):
- if isinstance(other, Sms):
- return self.msg == other.msg
- return self.msg == other
-
- def src_msisdn(self):
- return self._src_msisdn
-
- def dst_msisdn(self):
- return self._dst_msisdn
-
- def matches(self, msg):
- return self.msg == msg
-
-# vim: expandtab tabstop=4 shiftwidth=4