• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python assertMy.equals函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中assertMy.equals函数的典型用法代码示例。如果您正苦于以下问题:Python equals函数的具体用法?Python equals怎么用?Python equals使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了equals函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_testName

	def test_testName(self):
		color.blue("test here baby")
		obj = ("hello\n world", ['org', 'ok'])
		result = assertMy.objToStr(obj)
		expected = """("hello
 world", ["org", "ok"])"""
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:sublime_util,代码行数:7,代码来源:objToStr2_test.py


示例2: test_testName

	def test_testName(self):
		color.blue("test here baby")

		filename = os.path.dirname(os.path.realpath(__file__)) + "/poligion/poligon.go"
		position = 56

		expected = os.path.dirname(os.path.realpath(__file__)) +  "/poligion/Test_doAllForMiByUrl_test.go"
		if os.path.isfile(expected):
			os.remove(expected)
		result = generateTestFileNameForGoTest.createFromPosition(filename, position)
		testFileContent = filer2.read(result)

		expectedText = """package elit
import (
    "my"
	"testing"
)

func Test_doAllForMiByUrl(t *testing.T) {
    var (
	

	url string
	expected menuItem
	t *testing.T


        )
    doAllForMiByUrl(url,expected,t)
    
}"""


		assertMy.equals(result, expected)
		assertMy.equals(testFileContent, expectedText)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:35,代码来源:createFromPosition1_test.py


示例3: test_testName

	def test_testName(self):
		color.blue("test here baby")
		source = os.path.join(currentFolder, 'filesPoligon/source.iced')
		target = os.path.join(currentFolder, 'filesPoligon/poligon.iced')
		result = relativeRequireIced_model.do(target, source)
		expected = ("poligon = require './poligon.iced'", 'await poligon countryId, regionId, defer result')
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:7,代码来源:do_test.py


示例4: test_testName

	def test_testName(self):
		color.blue("test here baby")
		inputText = "import\n\t\ndef func"
		result = duplicateLines.remove(inputText)

		expected = inputText
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:7,代码来源:noDuplicateLinesForNextLineWithTabs_test.py


示例5: test_testName

	def test_testName(self):
		color.blue("test here baby")
		source = os.path.join(currentFolder, 'filesPoligon/source.iced')
		target = os.path.join(currentFolder, 'filesPoligon/targetEmptyParams.iced')
		result = relativeRequireIced_model.do(target, source)
		expected = ("targetEmptyParams = require './targetEmptyParams.iced'", 'await targetEmptyParams defer result')
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:7,代码来源:do_emptyParams_test.py


示例6: test_testName

	def test_testName(self):
		color.blue("test here baby")
		source = "/Users/maks/Dropbox/nodeApps/orad/domain.iced"
		target = "/Users/maks/Dropbox/nodeApps/orad/test/passByOrgEmailCheck_test.iced"
		result = absRel3.RelAndCutIfNodeModules(source, target)
		expected = "./test/passByOrgEmailCheck_test.iced"
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:7,代码来源:RelAndCutIfNodeModules_internal_test.py


示例7: test_testName

	def test_testName(self):
		color.blue("test here baby")
		testFolder = "/Users/maks/Library/Application Support/Sublime Text 3/Packages/makeTest/test/poligon"
		methodName = "myMethod"
		result = generateTestFileNameForGoTest.createFileNameForGoTest(testFolder, methodName)
		expected = ("/Users/maks/Library/Application Support/Sublime Text 3/Packages/makeTest/test/poligon/myMethod_test.go", 0)
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:7,代码来源:createFileNameForGoTest_test.py


示例8: test_testName

	def test_testName(self):
		color.blue("virsion")
		print(sys.version_info)
		inputModel = os.path.join(currentFolder, 'filesPoligon/poligon.iced')
		result = getParams.fileNameToParamString(inputModel)
		expected = "countryId, regionId"
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:7,代码来源:fileNameToParamString_test.py


示例9: test_testName

	def test_testName(self):
		color.blue("test here baby")
		result = generateTestFileNameForGoTest.splitArgs("par1 int, par2 string")
		expected = [{'var': 'par1', 'varType': 'int'}, {'var': 'par2', 'varType': 'string'}]
		
		# assert_that(result == expected)
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:7,代码来源:splitArgs_test.py


示例10: test_testName

	def test_testName(self):
		color.blue("test here baby")
		fileName="/Users/maks/Library/Application Support/Sublime Text 3/Packages/navigateTo/test/fileNameAndPositionTo_goRunTestCommand/poligon.go"
		pos = 285
		result = navigateToModel.fileNameAndPositionTo_goRunTestCommand(fileName, pos)
		expected = "go test -test.run Test_toJson"
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:7,代码来源:fileNameAndPositionTo_goRunTestCommand_test.py


示例11: test_testName

	def test_testName(self):
		color.blue("test here baby")
		sourceFilePath = "/Users/maks/Dropbox/nodeApps/orad/test/sodora.iced"
		targetFilePath = "/Users/maks/Dropbox/nodeApps/orad/domain.iced"
		result = absRel3.filePathInsideCurrentProject(sourceFilePath, targetFilePath)
		expected = True
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:7,代码来源:filePathInsideCurrentProject_true_test.py


示例12: test_testName

	def test_testName(self):
		color.blue("test here baby")
		targetFileContent = """th = require 'throw'
getCitiesByCountry = require './getCitiesByCountry.iced'
regionsByCountryId = require '../../region/regionsByCountryId.iced'
citiesByRegionId_slow = require './citiesByRegionId_slow.iced'
_ = require 'underscore'		


module.exports = (db, countryId, autocb)->
	await getCitiesByCountry db, countryId, defer result
	[err, cityList] = result
	th.err err
	
	unless cityList
		await regionsByCountryId db, countryId, defer result
		[err, regions] = result
		th.err err

		cityList = []

		for region in regions
			await citiesByRegionId_slow db, regionId, defer result
			[err, cities] = result
			th.err err

			cityList = _.union cityList, cities


	return cityList"""
		result = returnLast.autocbOneEnding(targetFileContent)
		expected = "cityList"
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:33,代码来源:autocbOneEnding_test.py


示例13: test_testName

	def test_testName(self):
		color.blue("test here baby")
		fileContent = """th = require 'throw'
th.Throw()	
assert = require 'assert'

module.exports = (input, test)->
	th.log "input"
	th.log input
	inputModel = require "./#{input}/input.js"
	th.log "inputModel"
	th.log inputModel

	

	th.log "actual"
	th.log actual
	th.log "actual.length"
	th.log actual.length

	expected = require "./#{input}/expected.js"
	
	actual = JSON.stringify actual
	expected = JSON.stringify expected
	assert.deepEqual actual, expected
	
	db.fin()
	test.done()"""
		result = relativeRequireIced_model.removeRowsStartingFromSpace(fileContent)
		expected = """th = require 'throw'
th.Throw()	
assert = require 'assert'"""
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:33,代码来源:removeRowsStartingFromSpace_test.py


示例14: test_testName

	def test_testName(self):
		color.blue("test here baby")
		filename = os.path.abspath(os.path.join(currentFolder, '../../makeTestForGo/test/createFileName1_test/deep/deep/deep/a.py'))
		position = 10

		testFile = forPy.createFromPosition(filename, position)

		 
		result = filer.read(testFile)
		expected = """import unittest
import sys
sys.path.insert(0, '/Users/maks/Library/Application Support/Sublime Text 3/Packages/util')
sys.path.insert(0, '/Users/maks/Library/Application Support/Sublime Text 3/Packages/makeTest/test/createFileName1_test/deep/deep/deep')
import color
import assertMy
import a

class Test(unittest.TestCase):
	def test_testName(self):
		color.blue("test here baby")
		result = a.()
		expected = ""
		assertMy.equals(result, expected)

if __name__ == '__main__':
	unittest.main()"""
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:27,代码来源:createFromPosition_tempOff.py


示例15: test_testName

	def test_testName(self):
		color.blue("test here baby")
		sourceFileContent = """th = require 'throw'
th.Throw()	
assert = require 'assert'

module.exports = (input, test)->
	th.log "input"
	th.log input
	inputModel = require "./#{input}/input.js"
	th.log "inputModel"
	th.log inputModel

	

	th.log "actual"
	th.log actual
	th.log "actual.length"
	th.log actual.length

	expected = require "./#{input}/expected.js"
	
	actual = JSON.stringify actual
	expected = JSON.stringify expected
	assert.deepEqual actual, expected
	
	db.fin()
	test.done()
	"""
		result = relativeRequireIced_model.getPositionInSourceWhereToPaste_bySourceFileContent(sourceFileContent)
		expected = 58
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:32,代码来源:requireInside_getPositionInSourceWhereToPaste_bySourceFileContent_test.py


示例16: test_testName

	def test_testName(self):
		color.blue("test here baby")
		fileContent = """// Sometimes we'll want to sort a collection by something
// other than its natural order. For example, suppose we
// wanted to sort strings by their length instead of
// alphabetically. Here's an example of custom sorts
// in Go.

package my

import (
	"reflect"
	"testing"

	"myColors"
)

func Test(actual interface{}, expected interface{}, t *testing.T) {
	myColors.P("actual")
	myColors.P(actual)
	myColors.P("expected")
	myColors.P(expected)
	eq := reflect.DeepEqual(actual, expected)
	if !eq {
		t.Errorf("not equal")
	}
}
"""
		result = generateTestFileNameForGoTest.getPackageName(fileContent)
		expected = "my"
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:31,代码来源:getPackageName_test.py


示例17: test_testName

	def test_testName(self):
		color.blue("test here baby")
		(packageName, testMethodName, caller, method, args, returnParams) = ("ordb", "TestRubricById", "org *Org", "GetRubricById", "orgId string, someBool bool", "orgResult *Org, ok bool")
		result = generateTestFileNameForGoTest.generateTestTextByGoFuncDeclarationParts(packageName, testMethodName, caller, method, args, returnParams)
		expected = """package ordb
import (
    "my"
	"testing"
)

func TestRubricById(t *testing.T) {
    var (
	org *Org

	orgId string
	someBool bool

	orgResult *Org
	ok bool

	orgResult_expected *Org
	ok_expected bool
        )
    orgResult,ok = org.GetRubricById(orgId,someBool)
    
	expectedJson_orgResult := ``
	my.FromJson(expectedJson_orgResult, &orgResult_expected)
	my.Test(orgResult, orgResult_expected, t)
	expectedJson_ok := ``
	my.FromJson(expectedJson_ok, &ok_expected)
	my.Test(ok, ok_expected, t)
}"""
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:33,代码来源:generateTestTextByGoFuncDeclarationParts_test.py


示例18: test_testName

	def test_testName(self):
		color.blue("test here baby")
		source = os.path.join(currentFolder, 'filesPoligon/source.iced')
		target = os.path.join(currentFolder, 'filesPoligon/targetSync.iced')
		result = relativeRequireIced_model.do(target, source)
		expected = ("targetSync = require './targetSync.iced'", 'actual = targetSync arg1, arg2')
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:7,代码来源:do_sync_test.py


示例19: test_testName

	def test_testName(self):
		color.blue("test here baby")
		text = """// Sometimes we'll want to sort a collection by something
// other than its natural order. For example, suppose we
// wanted to sort strings by their length instead of
// alphabetically. Here's an example of custom sorts
// in Go.

package elit

import (
	"encoding/json"
)

func Test_toJson(t *testing.T) {

	actual := toJson(FotoList{
		{bigFoto: "1.jpg"},
		{bigFoto: "10.jpg"},
	})
	expected := ""
	my.Test(actual, expected, t)
}
"""		
		pos = 287
		result = navigateToModel.getMethodNameGo(text, pos)
		expected = "Test_toJson"
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:28,代码来源:getMethodNameGo_test.py


示例20: test_testName

	def test_testName(self):
		color.blue("test here baby")
		fileName = "/Users/maks/Library/Application Support/Sublime Text 3/Packages/relative/returnLastString/test/poligon/testFile.iced"
		result = returnLast.doAllByFileName(fileName)
		expected = """[err, telIdList] = result
th.err err"""
		assertMy.equals(result, expected)
开发者ID:ypapax,项目名称:all_sublime_plugins,代码行数:7,代码来源:doAllByFileName_test.py



注:本文中的assertMy.equals函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python assertion_report.assertion_report函数代码示例发布时间:2022-05-24
下一篇:
Python assembler.eloc函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap