File: print.test.py

package info (click to toggle)
tarantool 1.7.2.385.g952d79e-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 21,556 kB
  • ctags: 28,405
  • sloc: ansic: 180,313; cpp: 26,044; sh: 15,513; python: 4,893; makefile: 1,412
file content (34 lines) | stat: -rw-r--r-- 673 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import tarantool

import sys
import os
import re

log = server.get_log()

admin('print("Hello, world")')
admin("io = require('io')")

admin("""local f = require('fiber').create(
    function()
        print('Ehllo, world')
        io.flush()
    end
)""")
admin("require('fiber').sleep(0.1)")

print("Check log line (Hello):")
print('---')
if log.seek_once('Hello') >= 0:
    print('- "logfile contains "Hello""')
else:
    print('- "logfile does not contain "Hello""')
print('...')

print("Check log line (Ehllo):")
print('---')
if log.seek_once('Ehllo') >= 0:
    print('- "logfile contains "Ehllo""')
else:
    print('- "logfile does not contain "Ehllo""')
print('...')