Linux websever 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
Apache/2.4.52 (Ubuntu)
: 192.168.3.70 | : 192.168.1.99
Cant Read [ /etc/named.conf ]
8.1.2-1ubuntu2.23
urlab
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
samba /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
blackbox
[ DIR ]
drwxr-xr-x
dcerpc
[ DIR ]
drwxr-xr-x
dns_forwarder_helpers
[ DIR ]
drwxr-xr-x
emulate
[ DIR ]
drwxr-xr-x
kcc
[ DIR ]
drwxr-xr-x
krb5
[ DIR ]
drwxr-xr-x
samba_tool
[ DIR ]
drwxr-xr-x
__init__.py
22.9
KB
-rw-r--r--
audit_log_base.py
6.98
KB
-rw-r--r--
audit_log_dsdb.py
24.46
KB
-rw-r--r--
audit_log_pass_change.py
12.86
KB
-rw-r--r--
auth.py
4.5
KB
-rw-r--r--
auth_log.py
65.62
KB
-rw-r--r--
auth_log_base.py
5.42
KB
-rw-r--r--
auth_log_ncalrpc.py
4.19
KB
-rw-r--r--
auth_log_netlogon.py
5.22
KB
-rw-r--r--
auth_log_netlogon_bad_creds.py
7.7
KB
-rw-r--r--
auth_log_pass_change.py
12.92
KB
-rw-r--r--
auth_log_samlogon.py
6.68
KB
-rw-r--r--
auth_log_winbind.py
19.13
KB
-rw-r--r--
common.py
3.06
KB
-rw-r--r--
complex_expressions.py
18.37
KB
-rw-r--r--
core.py
2.77
KB
-rw-r--r--
cred_opt.py
1.73
KB
-rw-r--r--
credentials.py
22.13
KB
-rw-r--r--
dckeytab.py
2.11
KB
-rw-r--r--
dns.py
84.34
KB
-rw-r--r--
dns_aging.py
108.76
KB
-rw-r--r--
dns_base.py
14.3
KB
-rw-r--r--
dns_forwarder.py
20.95
KB
-rw-r--r--
dns_invalid.py
2.66
KB
-rw-r--r--
dns_packet.py
7.13
KB
-rw-r--r--
dns_tkey.py
7.11
KB
-rw-r--r--
dns_wildcard.py
12.89
KB
-rw-r--r--
docs.py
18.25
KB
-rw-r--r--
domain_backup.py
26.76
KB
-rw-r--r--
domain_backup_offline.py
10.01
KB
-rw-r--r--
dsdb.py
41.91
KB
-rw-r--r--
dsdb_api.py
1.93
KB
-rw-r--r--
dsdb_dns.py
2.56
KB
-rw-r--r--
dsdb_lock.py
11.63
KB
-rw-r--r--
dsdb_schema_attributes.py
8.9
KB
-rw-r--r--
encrypted_secrets.py
3.02
KB
-rw-r--r--
gensec.py
8.91
KB
-rw-r--r--
get_opt.py
2.47
KB
-rw-r--r--
getdcname.py
18.52
KB
-rw-r--r--
glue.py
3.75
KB
-rw-r--r--
gpo.py
80.28
KB
-rw-r--r--
gpo_member.py
1.69
KB
-rw-r--r--
graph.py
26.45
KB
-rw-r--r--
group_audit.py
16.52
KB
-rw-r--r--
hostconfig.py
2.14
KB
-rw-r--r--
imports.py
1.12
KB
-rw-r--r--
join.py
6.71
KB
-rw-r--r--
krb5_credentials.py
3.8
KB
-rw-r--r--
ldap_raw.py
31.92
KB
-rw-r--r--
ldap_referrals.py
3.13
KB
-rw-r--r--
ldap_spn.py
34.19
KB
-rw-r--r--
ldap_upn_sam_account.py
17.63
KB
-rw-r--r--
libsmb.py
4.26
KB
-rw-r--r--
loadparm.py
3.25
KB
-rw-r--r--
lsa_string.py
2.22
KB
-rw-r--r--
messaging.py
4.97
KB
-rw-r--r--
ndr.py
4.09
KB
-rw-r--r--
net_join.py
2.29
KB
-rw-r--r--
net_join_no_spnego.py
3.46
KB
-rw-r--r--
netbios.py
2.08
KB
-rw-r--r--
netcmd.py
5.32
KB
-rw-r--r--
netlogonsvc.py
2.43
KB
-rw-r--r--
ntacls.py
3.68
KB
-rw-r--r--
ntacls_backup.py
6.58
KB
-rw-r--r--
ntlm_auth.py
13.08
KB
-rw-r--r--
ntlm_auth_base.py
8.5
KB
-rw-r--r--
ntlm_auth_krb5.py
3.63
KB
-rw-r--r--
ntlmdisabled.py
3.01
KB
-rw-r--r--
pam_winbind.py
2.52
KB
-rw-r--r--
pam_winbind_chauthtok.py
1.56
KB
-rw-r--r--
pam_winbind_warn_pwd_expire.py
2.01
KB
-rw-r--r--
param.py
3.58
KB
-rw-r--r--
password_hash.py
12.43
KB
-rw-r--r--
password_hash_fl2003.py
7.34
KB
-rw-r--r--
password_hash_fl2008.py
7.89
KB
-rw-r--r--
password_hash_gpgme.py
11.88
KB
-rw-r--r--
password_hash_ldap.py
4.85
KB
-rw-r--r--
password_quality.py
2.15
KB
-rw-r--r--
password_test.py
1.94
KB
-rw-r--r--
policy.py
1.17
KB
-rw-r--r--
posixacl.py
38.89
KB
-rw-r--r--
prefork_restart.py
16
KB
-rw-r--r--
process_limits.py
2.95
KB
-rw-r--r--
provision.py
6.35
KB
-rw-r--r--
pso.py
11.23
KB
-rw-r--r--
py_credentials.py
14.82
KB
-rw-r--r--
registry.py
2.5
KB
-rw-r--r--
s3_net_join.py
2.63
KB
-rw-r--r--
s3idmapdb.py
1.95
KB
-rw-r--r--
s3param.py
1.75
KB
-rw-r--r--
s3passdb.py
5.66
KB
-rw-r--r--
s3registry.py
1.82
KB
-rw-r--r--
s3windb.py
1.48
KB
-rw-r--r--
samba3sam.py
48.45
KB
-rw-r--r--
samba_upgradedns_lmdb.py
2.56
KB
-rw-r--r--
samdb.py
2.51
KB
-rw-r--r--
samdb_api.py
5.41
KB
-rw-r--r--
sddl.py
8.86
KB
-rw-r--r--
security.py
6.25
KB
-rw-r--r--
segfault.py
7
KB
-rw-r--r--
smb-notify.py
18.85
KB
-rw-r--r--
smb.py
9.47
KB
-rw-r--r--
smbd_base.py
1.76
KB
-rw-r--r--
smbd_fuzztest.py
3.5
KB
-rw-r--r--
source.py
8.74
KB
-rw-r--r--
strings.py
3.89
KB
-rw-r--r--
subunitrun.py
2.33
KB
-rw-r--r--
tdb_util.py
1.76
KB
-rw-r--r--
upgrade.py
1.36
KB
-rw-r--r--
upgradeprovision.py
6.65
KB
-rw-r--r--
upgradeprovisionneeddc.py
7.49
KB
-rw-r--r--
usage.py
12.98
KB
-rw-r--r--
xattr.py
5.27
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : graph.py
# -*- coding: utf-8 -*- # Test graph dot file generation # # Copyright (C) Andrew Bartlett 2018. # # Written by Douglas Bagnall <douglas.bagnall@catalyst.net.nz> # # 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/>. """Tests for samba.graph""" import samba import samba.tests from samba import graph import re import itertools class DotFileTests(samba.tests.TestCaseInTempDir): def assertMatch(self, exp, s): m = re.match(exp, s) if m is None: self.fail("%r did not match /%s/" % (s, exp)) return m def assertHeader(self, lines, title, directed): self.assertEqual(lines[0], '/* generated by samba */') if directed: exp = r'^digraph \w+ {$' else: exp = r'^graph \w+ {$' self.assertMatch(exp, lines[1]) m = self.assertMatch(r'^label="([\w ]+)";$', lines[2]) self.assertEqual(m.group(1), title) self.assertMatch(r'^fontsize=10;$', lines[3]) self.assertMatch(r'$', lines[4]) self.assertEqual(lines[5], 'node[fontname=Helvetica; fontsize=10];') self.assertEqual(lines[6], '') def assertVertices(self, lines, names): for n, line in zip(names, lines): m = self.assertMatch(r'^"(\w+)";$', line) self.assertEqual(n, m.group(1)) def assertEdges(self, lines, edges, directed): connector = '->' if directed else '--' for edge, line in zip(edges, lines): a, b = edge m = self.assertMatch((r'^"(\w+)" ([>-]{2}) ' r'"(\w+)" ?(?:\[([^\]])\])?;$'), line) self.assertEqual(m.group(1), a) self.assertEqual(m.group(2), connector) self.assertEqual(m.group(3), b) if m.group(4): self.assertMatch(r'^[\w ]*$', m.group(4)) def test_basic_dot_files(self): vertices = tuple('abcdefgh') all_edges = tuple(itertools.combinations(vertices, 2)) line_edges = list(zip(vertices[1:], vertices[:-1])) ring_edges = line_edges + [(vertices[0], vertices[-1])] no_edges = [] # even join to even numbers, odd to odd disjoint_edges = [(a, b) for a, b in all_edges if ord(a) ^ ord(b) == 0] for name, edges in (('all', all_edges), ('line', line_edges), ('ring', ring_edges), ('no', no_edges), ('disjoint', disjoint_edges)): for directed, tag in ((True, "directed"), (False, "undirected")): title = "%s %s" % (name, tag) g = graph.dot_graph(vertices, edges, directed=directed, title=title) lines = g.split('\n') self.assertHeader(lines, title, directed) self.assertVertices(lines[7:], vertices) self.assertEdges(lines[len(vertices) + 7:], edges, directed) class DistanceTests(samba.tests.TestCase): def setUp(self): super(DistanceTests, self).setUp() # a sorted list of colour set names. self.sorted_colour_sets = sorted( graph.COLOUR_SETS, # return '' for None, so it's sortable. key=lambda name: name or '') def test_simple_distance(self): edges = [('ant', 'bat'), ('cat', 'dog'), ('ant', 'elephant'), ('elephant', 'dog'), ('bat', 'dog'), ('frog', 'elephant'), ('frog', 'cat'), ('bat', 'elephant'), ('elephant', 'cat'), ('cat', 'ant'), ('cat', 'dog')] expected = { "utf8 True, colour None": ''' destination â•────── ant │â•───── bat ││â•──── cat │││â•─── dog ││││â•── elephant source │││││â•─ frog ant ·1221- bat 3·211- cat 12·12- dog ---·-- elephant 2311·- frog 23121·''', 'utf8 True, colour ansi': ''' [4mdestination[0m [0m[37mâ•────── ant[0m [37m│[0m[1;30mâ•───── bat[0m [37m│[1;30m│[0m[37mâ•──── cat[0m [37m│[1;30m│[37m│[0m[1;30mâ•─── dog[0m [37m│[1;30m│[37m│[1;30m│[0m[37mâ•── elephant[0m [4msource[0m [37m│[1;30m│[37m│[1;30m│[37m│[0m[1;30mâ•─ frog[0m [37m ant[0m [0m[37m·[0m[1;32m1[0m[33m2[0m[33m2[0m[1;32m1[0m[1;31m-[0m [1;30m bat[0m [33m3[0m[0m[1;30m·[0m[33m2[0m[1;32m1[0m[1;32m1[0m[1;31m-[0m [37m cat[0m [1;32m1[0m[33m2[0m[0m[37m·[0m[1;32m1[0m[33m2[0m[1;31m-[0m [1;30m dog[0m [1;31m-[1;31m-[1;31m-[0m[1;30m·[0m[1;31m-[1;31m-[0m [37melephant[0m [33m2[0m[33m3[0m[1;32m1[0m[1;32m1[0m[0m[37m·[0m[1;31m-[0m [1;30m frog[0m [33m2[0m[33m3[0m[1;32m1[0m[33m2[0m[1;32m1[0m[0m[1;30m·[0m[0m ''', 'utf8 True, colour ansi-heatmap': ''' [4mdestination[0m [0m[37mâ•────── ant[0m [37m│[0m[1;30mâ•───── bat[0m [37m│[1;30m│[0m[37mâ•──── cat[0m [37m│[1;30m│[37m│[0m[1;30mâ•─── dog[0m [37m│[1;30m│[37m│[1;30m│[0m[37mâ•── elephant[0m [4msource[0m [37m│[1;30m│[37m│[1;30m│[37m│[0m[1;30mâ•─ frog[0m [37m ant[0m [0m[37m·[0m[1;42m1[0m[43m2[0m[43m2[0m[1;42m1[0m[1;41m-[0m [1;30m bat[0m [43m3[0m[0m[1;30m·[0m[43m2[0m[1;42m1[0m[1;42m1[0m[1;41m-[0m [37m cat[0m [1;42m1[0m[43m2[0m[0m[37m·[0m[1;42m1[0m[43m2[0m[1;41m-[0m [1;30m dog[0m [1;41m-[1;41m-[1;41m-[0m[1;30m·[0m[1;41m-[1;41m-[0m [37melephant[0m [43m2[0m[43m3[0m[1;42m1[0m[1;42m1[0m[0m[37m·[0m[1;41m-[0m [1;30m frog[0m [43m2[0m[43m3[0m[1;42m1[0m[43m2[0m[1;42m1[0m[0m[1;30m·[0m[0m ''', 'utf8 True, colour xterm-256color': ''' [4mdestination[0m [0m[38;5;39mâ•────── ant[0m [38;5;39m│[0m[38;5;45mâ•───── bat[0m [38;5;39m│[38;5;45m│[0m[38;5;39mâ•──── cat[0m [38;5;39m│[38;5;45m│[38;5;39m│[0m[38;5;45mâ•─── dog[0m [38;5;39m│[38;5;45m│[38;5;39m│[38;5;45m│[0m[38;5;39mâ•── elephant[0m [4msource[0m [38;5;39m│[38;5;45m│[38;5;39m│[38;5;45m│[38;5;39m│[0m[38;5;45mâ•─ frog[0m [38;5;39m ant[0m [0m[38;5;39m·[0m[38;5;112m1[0m[38;5;214m2[0m[38;5;214m2[0m[38;5;112m1[0m[48;5;124m-[0m [38;5;45m bat[0m [38;5;208m3[0m[0m[38;5;45m·[0m[38;5;214m2[0m[38;5;112m1[0m[38;5;112m1[0m[48;5;124m-[0m [38;5;39m cat[0m [38;5;112m1[0m[38;5;214m2[0m[0m[38;5;39m·[0m[38;5;112m1[0m[38;5;214m2[0m[48;5;124m-[0m [38;5;45m dog[0m [48;5;124m-[48;5;124m-[48;5;124m-[0m[38;5;45m·[0m[48;5;124m-[48;5;124m-[0m [38;5;39melephant[0m [38;5;214m2[0m[38;5;208m3[0m[38;5;112m1[0m[38;5;112m1[0m[0m[38;5;39m·[0m[48;5;124m-[0m [38;5;45m frog[0m [38;5;214m2[0m[38;5;208m3[0m[38;5;112m1[0m[38;5;214m2[0m[38;5;112m1[0m[0m[38;5;45m·[0m[0m ''', 'utf8 True, colour xterm-256color-heatmap': ''' [4mdestination[0m [0m[38;5;171mâ•────── ant[0m [38;5;171m│[0m[38;5;207mâ•───── bat[0m [38;5;171m│[38;5;207m│[0m[38;5;171mâ•──── cat[0m [38;5;171m│[38;5;207m│[38;5;171m│[0m[38;5;207mâ•─── dog[0m [38;5;171m│[38;5;207m│[38;5;171m│[38;5;207m│[0m[38;5;171mâ•── elephant[0m [4msource[0m [38;5;171m│[38;5;207m│[38;5;171m│[38;5;207m│[38;5;171m│[0m[38;5;207mâ•─ frog[0m [38;5;171m ant[0m [0m[38;5;171m·[0m[48;5;112m1[0m[48;5;214m2[0m[48;5;214m2[0m[48;5;112m1[0m[48;5;124m-[0m [38;5;207m bat[0m [48;5;208m3[0m[0m[38;5;207m·[0m[48;5;214m2[0m[48;5;112m1[0m[48;5;112m1[0m[48;5;124m-[0m [38;5;171m cat[0m [48;5;112m1[0m[48;5;214m2[0m[0m[38;5;171m·[0m[48;5;112m1[0m[48;5;214m2[0m[48;5;124m-[0m [38;5;207m dog[0m [48;5;124m-[48;5;124m-[48;5;124m-[0m[38;5;207m·[0m[48;5;124m-[48;5;124m-[0m [38;5;171melephant[0m [48;5;214m2[0m[48;5;208m3[0m[48;5;112m1[0m[48;5;112m1[0m[0m[38;5;171m·[0m[48;5;124m-[0m [38;5;207m frog[0m [48;5;214m2[0m[48;5;208m3[0m[48;5;112m1[0m[48;5;214m2[0m[48;5;112m1[0m[0m[38;5;207m·[0m[0m ''', 'utf8 False, colour None': ''' destination ,------ ant |,----- bat ||,---- cat |||,--- dog ||||,-- elephant source |||||,- frog ant 01221- bat 30211- cat 12012- dog ---0-- elephant 23110- frog 231210 ''', 'utf8 False, colour ansi': ''' [4mdestination[0m [0m[37m,------ ant[0m [37m|[0m[1;30m,----- bat[0m [37m|[1;30m|[0m[37m,---- cat[0m [37m|[1;30m|[37m|[0m[1;30m,--- dog[0m [37m|[1;30m|[37m|[1;30m|[0m[37m,-- elephant[0m [4msource[0m [37m|[1;30m|[37m|[1;30m|[37m|[0m[1;30m,- frog[0m [37m ant[0m [0m[37m0[0m[1;32m1[0m[33m2[0m[33m2[0m[1;32m1[0m[1;31m-[0m [1;30m bat[0m [33m3[0m[0m[1;30m0[0m[33m2[0m[1;32m1[0m[1;32m1[0m[1;31m-[0m [37m cat[0m [1;32m1[0m[33m2[0m[0m[37m0[0m[1;32m1[0m[33m2[0m[1;31m-[0m [1;30m dog[0m [1;31m-[1;31m-[1;31m-[0m[1;30m0[0m[1;31m-[1;31m-[0m [37melephant[0m [33m2[0m[33m3[0m[1;32m1[0m[1;32m1[0m[0m[37m0[0m[1;31m-[0m [1;30m frog[0m [33m2[0m[33m3[0m[1;32m1[0m[33m2[0m[1;32m1[0m[0m[1;30m0[0m[0m ''', 'utf8 False, colour ansi-heatmap': ''' [4mdestination[0m [0m[37m,------ ant[0m [37m|[0m[1;30m,----- bat[0m [37m|[1;30m|[0m[37m,---- cat[0m [37m|[1;30m|[37m|[0m[1;30m,--- dog[0m [37m|[1;30m|[37m|[1;30m|[0m[37m,-- elephant[0m [4msource[0m [37m|[1;30m|[37m|[1;30m|[37m|[0m[1;30m,- frog[0m [37m ant[0m [0m[37m0[0m[1;42m1[0m[43m2[0m[43m2[0m[1;42m1[0m[1;41m-[0m [1;30m bat[0m [43m3[0m[0m[1;30m0[0m[43m2[0m[1;42m1[0m[1;42m1[0m[1;41m-[0m [37m cat[0m [1;42m1[0m[43m2[0m[0m[37m0[0m[1;42m1[0m[43m2[0m[1;41m-[0m [1;30m dog[0m [1;41m-[1;41m-[1;41m-[0m[1;30m0[0m[1;41m-[1;41m-[0m [37melephant[0m [43m2[0m[43m3[0m[1;42m1[0m[1;42m1[0m[0m[37m0[0m[1;41m-[0m [1;30m frog[0m [43m2[0m[43m3[0m[1;42m1[0m[43m2[0m[1;42m1[0m[0m[1;30m0[0m[0m ''', 'utf8 False, colour xterm-256color': ''' [4mdestination[0m [0m[38;5;39m,------ ant[0m [38;5;39m|[0m[38;5;45m,----- bat[0m [38;5;39m|[38;5;45m|[0m[38;5;39m,---- cat[0m [38;5;39m|[38;5;45m|[38;5;39m|[0m[38;5;45m,--- dog[0m [38;5;39m|[38;5;45m|[38;5;39m|[38;5;45m|[0m[38;5;39m,-- elephant[0m [4msource[0m [38;5;39m|[38;5;45m|[38;5;39m|[38;5;45m|[38;5;39m|[0m[38;5;45m,- frog[0m [38;5;39m ant[0m [0m[38;5;39m0[0m[38;5;112m1[0m[38;5;214m2[0m[38;5;214m2[0m[38;5;112m1[0m[48;5;124m-[0m [38;5;45m bat[0m [38;5;208m3[0m[0m[38;5;45m0[0m[38;5;214m2[0m[38;5;112m1[0m[38;5;112m1[0m[48;5;124m-[0m [38;5;39m cat[0m [38;5;112m1[0m[38;5;214m2[0m[0m[38;5;39m0[0m[38;5;112m1[0m[38;5;214m2[0m[48;5;124m-[0m [38;5;45m dog[0m [48;5;124m-[48;5;124m-[48;5;124m-[0m[38;5;45m0[0m[48;5;124m-[48;5;124m-[0m [38;5;39melephant[0m [38;5;214m2[0m[38;5;208m3[0m[38;5;112m1[0m[38;5;112m1[0m[0m[38;5;39m0[0m[48;5;124m-[0m [38;5;45m frog[0m [38;5;214m2[0m[38;5;208m3[0m[38;5;112m1[0m[38;5;214m2[0m[38;5;112m1[0m[0m[38;5;45m0[0m[0m ''', 'utf8 False, colour xterm-256color-heatmap': ''' [4mdestination[0m [0m[38;5;171m,------ ant[0m [38;5;171m|[0m[38;5;207m,----- bat[0m [38;5;171m|[38;5;207m|[0m[38;5;171m,---- cat[0m [38;5;171m|[38;5;207m|[38;5;171m|[0m[38;5;207m,--- dog[0m [38;5;171m|[38;5;207m|[38;5;171m|[38;5;207m|[0m[38;5;171m,-- elephant[0m [4msource[0m [38;5;171m|[38;5;207m|[38;5;171m|[38;5;207m|[38;5;171m|[0m[38;5;207m,- frog[0m [38;5;171m ant[0m [0m[38;5;171m0[0m[48;5;112m1[0m[48;5;214m2[0m[48;5;214m2[0m[48;5;112m1[0m[48;5;124m-[0m [38;5;207m bat[0m [48;5;208m3[0m[0m[38;5;207m0[0m[48;5;214m2[0m[48;5;112m1[0m[48;5;112m1[0m[48;5;124m-[0m [38;5;171m cat[0m [48;5;112m1[0m[48;5;214m2[0m[0m[38;5;171m0[0m[48;5;112m1[0m[48;5;214m2[0m[48;5;124m-[0m [38;5;207m dog[0m [48;5;124m-[48;5;124m-[48;5;124m-[0m[38;5;207m0[0m[48;5;124m-[48;5;124m-[0m [38;5;171melephant[0m [48;5;214m2[0m[48;5;208m3[0m[48;5;112m1[0m[48;5;112m1[0m[0m[38;5;171m0[0m[48;5;124m-[0m [38;5;207m frog[0m [48;5;214m2[0m[48;5;208m3[0m[48;5;112m1[0m[48;5;214m2[0m[48;5;112m1[0m[0m[38;5;207m0[0m[0m ''' } for utf8 in (True, False): for colour in self.sorted_colour_sets: k = 'utf8 %s, colour %s' % (utf8, colour) s = graph.distance_matrix(None, edges, utf8=utf8, colour=colour) self.assertStringsEqual(s, expected[k], strip=True, msg='Wrong output: %s\n\n%s' % (k, s)) def test_simple_distance2(self): edges = [('ant', 'bat'), ('cat', 'bat'), ('bat', 'ant'), ('ant', 'cat')] expected = { 'utf8 True, colour None': ''' destination â•─── ant │â•── bat source ││â•─ cat ant ·11 bat 1·2 cat 21· ''', 'utf8 True, colour ansi': ''' [4mdestination[0m [0m[37mâ•─── ant[0m [37m│[0m[1;30mâ•── bat[0m [4msource[0m [37m│[1;30m│[0m[37mâ•─ cat[0m [37m ant[0m [0m[37m·[0m[1;32m1[0m[1;32m1[0m[0m [1;30m bat[0m [1;32m1[0m[0m[1;30m·[0m[33m2[0m[0m [37m cat[0m [33m2[0m[1;32m1[0m[0m[37m·[0m[0m ''', 'utf8 True, colour ansi-heatmap': ''' [4mdestination[0m [0m[37mâ•─── ant[0m [37m│[0m[1;30mâ•── bat[0m [4msource[0m [37m│[1;30m│[0m[37mâ•─ cat[0m [37m ant[0m [0m[37m·[0m[1;42m1[0m[1;42m1[0m[0m [1;30m bat[0m [1;42m1[0m[0m[1;30m·[0m[43m2[0m[0m [37m cat[0m [43m2[0m[1;42m1[0m[0m[37m·[0m[0m ''', 'utf8 True, colour xterm-256color': ''' [4mdestination[0m [0m[38;5;39mâ•─── ant[0m [38;5;39m│[0m[38;5;45mâ•── bat[0m [4msource[0m [38;5;39m│[38;5;45m│[0m[38;5;39mâ•─ cat[0m [38;5;39m ant[0m [0m[38;5;39m·[0m[38;5;112m1[0m[38;5;112m1[0m[0m [38;5;45m bat[0m [38;5;112m1[0m[0m[38;5;45m·[0m[38;5;208m2[0m[0m [38;5;39m cat[0m [38;5;208m2[0m[38;5;112m1[0m[0m[38;5;39m·[0m[0m ''', 'utf8 True, colour xterm-256color-heatmap': ''' [4mdestination[0m [0m[38;5;171mâ•─── ant[0m [38;5;171m│[0m[38;5;207mâ•── bat[0m [4msource[0m [38;5;171m│[38;5;207m│[0m[38;5;171mâ•─ cat[0m [38;5;171m ant[0m [0m[38;5;171m·[0m[48;5;112m1[0m[48;5;112m1[0m[0m [38;5;207m bat[0m [48;5;112m1[0m[0m[38;5;207m·[0m[48;5;208m2[0m[0m [38;5;171m cat[0m [48;5;208m2[0m[48;5;112m1[0m[0m[38;5;171m·[0m[0m ''', 'utf8 False, colour None': ''' destination ,--- ant |,-- bat source ||,- cat ant 011 bat 102 cat 210 ''', 'utf8 False, colour ansi': ''' [4mdestination[0m [0m[37m,--- ant[0m [37m|[0m[1;30m,-- bat[0m [4msource[0m [37m|[1;30m|[0m[37m,- cat[0m [37m ant[0m [0m[37m0[0m[1;32m1[0m[1;32m1[0m[0m [1;30m bat[0m [1;32m1[0m[0m[1;30m0[0m[33m2[0m[0m [37m cat[0m [33m2[0m[1;32m1[0m[0m[37m0[0m[0m ''', 'utf8 False, colour ansi-heatmap': ''' [4mdestination[0m [0m[37m,--- ant[0m [37m|[0m[1;30m,-- bat[0m [4msource[0m [37m|[1;30m|[0m[37m,- cat[0m [37m ant[0m [0m[37m0[0m[1;42m1[0m[1;42m1[0m[0m [1;30m bat[0m [1;42m1[0m[0m[1;30m0[0m[43m2[0m[0m [37m cat[0m [43m2[0m[1;42m1[0m[0m[37m0[0m[0m ''', 'utf8 False, colour xterm-256color': ''' [4mdestination[0m [0m[38;5;39m,--- ant[0m [38;5;39m|[0m[38;5;45m,-- bat[0m [4msource[0m [38;5;39m|[38;5;45m|[0m[38;5;39m,- cat[0m [38;5;39m ant[0m [0m[38;5;39m0[0m[38;5;112m1[0m[38;5;112m1[0m[0m [38;5;45m bat[0m [38;5;112m1[0m[0m[38;5;45m0[0m[38;5;208m2[0m[0m [38;5;39m cat[0m [38;5;208m2[0m[38;5;112m1[0m[0m[38;5;39m0[0m[0m ''', 'utf8 False, colour xterm-256color-heatmap': ''' [4mdestination[0m [0m[38;5;171m,--- ant[0m [38;5;171m|[0m[38;5;207m,-- bat[0m [4msource[0m [38;5;171m|[38;5;207m|[0m[38;5;171m,- cat[0m [38;5;171m ant[0m [0m[38;5;171m0[0m[48;5;112m1[0m[48;5;112m1[0m[0m [38;5;207m bat[0m [48;5;112m1[0m[0m[38;5;207m0[0m[48;5;208m2[0m[0m [38;5;171m cat[0m [48;5;208m2[0m[48;5;112m1[0m[0m[38;5;171m0[0m[0m ''' } for utf8 in (True, False): for colour in self.sorted_colour_sets: k = 'utf8 %s, colour %s' % (utf8, colour) s = graph.distance_matrix(None, edges, utf8=utf8, colour=colour) self.assertStringsEqual(s, expected[k], strip=True, msg='Wrong output: %s\n\n%s' % (k, s)) def test_simple_distance3(self): edges = [('ant', 'bat'), ('bat', 'cat'), ('cat', 'dog'), ('dog', 'ant'), ('dog', 'eel')] expected = { 'utf8 True, colour None': ''' destination â•───── ant │â•──── bat ││â•─── cat │││â•── dog source ││││â•─ eel ant ·1234 bat 3·123 cat 23·12 dog 123·1 eel ----· ''', 'utf8 True, colour ansi': ''' [4mdestination[0m [0m[37mâ•───── ant[0m [37m│[0m[1;30mâ•──── bat[0m [37m│[1;30m│[0m[37mâ•─── cat[0m [37m│[1;30m│[37m│[0m[1;30mâ•── dog[0m [4msource[0m [37m│[1;30m│[37m│[1;30m│[0m[37mâ•─ eel[0m [37m ant[0m [0m[37m·[0m[1;32m1[0m[33m2[0m[33m3[0m[33m4[0m[0m [1;30m bat[0m [33m3[0m[0m[1;30m·[0m[1;32m1[0m[33m2[0m[33m3[0m[0m [37m cat[0m [33m2[0m[33m3[0m[0m[37m·[0m[1;32m1[0m[33m2[0m[0m [1;30m dog[0m [1;32m1[0m[33m2[0m[33m3[0m[0m[1;30m·[0m[1;32m1[0m[0m [37m eel[0m [1;31m-[1;31m-[1;31m-[1;31m-[0m[37m·[0m[0m ''', 'utf8 True, colour ansi-heatmap': ''' [4mdestination[0m [0m[37mâ•───── ant[0m [37m│[0m[1;30mâ•──── bat[0m [37m│[1;30m│[0m[37mâ•─── cat[0m [37m│[1;30m│[37m│[0m[1;30mâ•── dog[0m [4msource[0m [37m│[1;30m│[37m│[1;30m│[0m[37mâ•─ eel[0m [37m ant[0m [0m[37m·[0m[1;42m1[0m[43m2[0m[43m3[0m[43m4[0m[0m [1;30m bat[0m [43m3[0m[0m[1;30m·[0m[1;42m1[0m[43m2[0m[43m3[0m[0m [37m cat[0m [43m2[0m[43m3[0m[0m[37m·[0m[1;42m1[0m[43m2[0m[0m [1;30m dog[0m [1;42m1[0m[43m2[0m[43m3[0m[0m[1;30m·[0m[1;42m1[0m[0m [37m eel[0m [1;41m-[1;41m-[1;41m-[1;41m-[0m[37m·[0m[0m ''', 'utf8 True, colour xterm-256color': ''' [4mdestination[0m [0m[38;5;39mâ•───── ant[0m [38;5;39m│[0m[38;5;45mâ•──── bat[0m [38;5;39m│[38;5;45m│[0m[38;5;39mâ•─── cat[0m [38;5;39m│[38;5;45m│[38;5;39m│[0m[38;5;45mâ•── dog[0m [4msource[0m [38;5;39m│[38;5;45m│[38;5;39m│[38;5;45m│[0m[38;5;39mâ•─ eel[0m [38;5;39m ant[0m [0m[38;5;39m·[0m[38;5;112m1[0m[38;5;214m2[0m[38;5;208m3[0m[38;5;208m4[0m[0m [38;5;45m bat[0m [38;5;208m3[0m[0m[38;5;45m·[0m[38;5;112m1[0m[38;5;214m2[0m[38;5;208m3[0m[0m [38;5;39m cat[0m [38;5;214m2[0m[38;5;208m3[0m[0m[38;5;39m·[0m[38;5;112m1[0m[38;5;214m2[0m[0m [38;5;45m dog[0m [38;5;112m1[0m[38;5;214m2[0m[38;5;208m3[0m[0m[38;5;45m·[0m[38;5;112m1[0m[0m [38;5;39m eel[0m [48;5;124m-[48;5;124m-[48;5;124m-[48;5;124m-[0m[38;5;39m·[0m[0m ''', 'utf8 True, colour xterm-256color-heatmap': ''' [4mdestination[0m [0m[38;5;171mâ•───── ant[0m [38;5;171m│[0m[38;5;207mâ•──── bat[0m [38;5;171m│[38;5;207m│[0m[38;5;171mâ•─── cat[0m [38;5;171m│[38;5;207m│[38;5;171m│[0m[38;5;207mâ•── dog[0m [4msource[0m [38;5;171m│[38;5;207m│[38;5;171m│[38;5;207m│[0m[38;5;171mâ•─ eel[0m [38;5;171m ant[0m [0m[38;5;171m·[0m[48;5;112m1[0m[48;5;214m2[0m[48;5;208m3[0m[48;5;208m4[0m[0m [38;5;207m bat[0m [48;5;208m3[0m[0m[38;5;207m·[0m[48;5;112m1[0m[48;5;214m2[0m[48;5;208m3[0m[0m [38;5;171m cat[0m [48;5;214m2[0m[48;5;208m3[0m[0m[38;5;171m·[0m[48;5;112m1[0m[48;5;214m2[0m[0m [38;5;207m dog[0m [48;5;112m1[0m[48;5;214m2[0m[48;5;208m3[0m[0m[38;5;207m·[0m[48;5;112m1[0m[0m [38;5;171m eel[0m [48;5;124m-[48;5;124m-[48;5;124m-[48;5;124m-[0m[38;5;171m·[0m[0m ''', 'utf8 False, colour None': ''' destination ,----- ant |,---- bat ||,--- cat |||,-- dog source ||||,- eel ant 01234 bat 30123 cat 23012 dog 12301 eel ----0 ''', 'utf8 False, colour ansi': ''' [4mdestination[0m [0m[37m,----- ant[0m [37m|[0m[1;30m,---- bat[0m [37m|[1;30m|[0m[37m,--- cat[0m [37m|[1;30m|[37m|[0m[1;30m,-- dog[0m [4msource[0m [37m|[1;30m|[37m|[1;30m|[0m[37m,- eel[0m [37m ant[0m [0m[37m0[0m[1;32m1[0m[33m2[0m[33m3[0m[33m4[0m[0m [1;30m bat[0m [33m3[0m[0m[1;30m0[0m[1;32m1[0m[33m2[0m[33m3[0m[0m [37m cat[0m [33m2[0m[33m3[0m[0m[37m0[0m[1;32m1[0m[33m2[0m[0m [1;30m dog[0m [1;32m1[0m[33m2[0m[33m3[0m[0m[1;30m0[0m[1;32m1[0m[0m [37m eel[0m [1;31m-[1;31m-[1;31m-[1;31m-[0m[37m0[0m[0m ''', 'utf8 False, colour ansi-heatmap': ''' [4mdestination[0m [0m[37m,----- ant[0m [37m|[0m[1;30m,---- bat[0m [37m|[1;30m|[0m[37m,--- cat[0m [37m|[1;30m|[37m|[0m[1;30m,-- dog[0m [4msource[0m [37m|[1;30m|[37m|[1;30m|[0m[37m,- eel[0m [37m ant[0m [0m[37m0[0m[1;42m1[0m[43m2[0m[43m3[0m[43m4[0m[0m [1;30m bat[0m [43m3[0m[0m[1;30m0[0m[1;42m1[0m[43m2[0m[43m3[0m[0m [37m cat[0m [43m2[0m[43m3[0m[0m[37m0[0m[1;42m1[0m[43m2[0m[0m [1;30m dog[0m [1;42m1[0m[43m2[0m[43m3[0m[0m[1;30m0[0m[1;42m1[0m[0m [37m eel[0m [1;41m-[1;41m-[1;41m-[1;41m-[0m[37m0[0m[0m ''', 'utf8 False, colour xterm-256color': ''' [4mdestination[0m [0m[38;5;39m,----- ant[0m [38;5;39m|[0m[38;5;45m,---- bat[0m [38;5;39m|[38;5;45m|[0m[38;5;39m,--- cat[0m [38;5;39m|[38;5;45m|[38;5;39m|[0m[38;5;45m,-- dog[0m [4msource[0m [38;5;39m|[38;5;45m|[38;5;39m|[38;5;45m|[0m[38;5;39m,- eel[0m [38;5;39m ant[0m [0m[38;5;39m0[0m[38;5;112m1[0m[38;5;214m2[0m[38;5;208m3[0m[38;5;208m4[0m[0m [38;5;45m bat[0m [38;5;208m3[0m[0m[38;5;45m0[0m[38;5;112m1[0m[38;5;214m2[0m[38;5;208m3[0m[0m [38;5;39m cat[0m [38;5;214m2[0m[38;5;208m3[0m[0m[38;5;39m0[0m[38;5;112m1[0m[38;5;214m2[0m[0m [38;5;45m dog[0m [38;5;112m1[0m[38;5;214m2[0m[38;5;208m3[0m[0m[38;5;45m0[0m[38;5;112m1[0m[0m [38;5;39m eel[0m [48;5;124m-[48;5;124m-[48;5;124m-[48;5;124m-[0m[38;5;39m0[0m[0m ''', 'utf8 False, colour xterm-256color-heatmap': ''' [4mdestination[0m [0m[38;5;171m,----- ant[0m [38;5;171m|[0m[38;5;207m,---- bat[0m [38;5;171m|[38;5;207m|[0m[38;5;171m,--- cat[0m [38;5;171m|[38;5;207m|[38;5;171m|[0m[38;5;207m,-- dog[0m [4msource[0m [38;5;171m|[38;5;207m|[38;5;171m|[38;5;207m|[0m[38;5;171m,- eel[0m [38;5;171m ant[0m [0m[38;5;171m0[0m[48;5;112m1[0m[48;5;214m2[0m[48;5;208m3[0m[48;5;208m4[0m[0m [38;5;207m bat[0m [48;5;208m3[0m[0m[38;5;207m0[0m[48;5;112m1[0m[48;5;214m2[0m[48;5;208m3[0m[0m [38;5;171m cat[0m [48;5;214m2[0m[48;5;208m3[0m[0m[38;5;171m0[0m[48;5;112m1[0m[48;5;214m2[0m[0m [38;5;207m dog[0m [48;5;112m1[0m[48;5;214m2[0m[48;5;208m3[0m[0m[38;5;207m0[0m[48;5;112m1[0m[0m [38;5;171m eel[0m [48;5;124m-[48;5;124m-[48;5;124m-[48;5;124m-[0m[38;5;171m0[0m[0m ''' } for utf8 in (True, False): for colour in self.sorted_colour_sets: k = 'utf8 %s, colour %s' % (utf8, colour) s = graph.distance_matrix(None, edges, utf8=utf8, colour=colour) self.assertStringsEqual(s, expected[k], strip=True, msg='Wrong output: %s\n\n%s' % (k, s))
Close